Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c5f67ae

Browse files
committed
Merge pull request #27 from dearing/dev
various fixes
2 parents ff91735 + 05bd032 commit c5f67ae

File tree

7 files changed

+91
-59
lines changed

7 files changed

+91
-59
lines changed

.kitchen.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ platforms:
1313
- name: ubuntu-14
1414
- name: ubuntu-15
1515

16-
transport:
17-
name: ssh
18-
compression: none
19-
2016
provisioner:
2117
name: chef_zero
2218
require_chef_omnibus: '11'

CHANGELOG.md

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,25 @@
1-
ellk CHANGELOG
2-
=============
3-
4-
This file is used to list changes made in each version of the ellk cookbook.
5-
6-
7-
0.3.2
8-
-----
9-
- Jacob Dearing - Cosmtic updates and Berkshelf pinning to avoid bug in Runit
10-
- https://github.com/dearing/ellk/issues/22
11-
12-
0.3.0
13-
-----
14-
- Jacob Dearing - Release-Ready for feedback. :8ball:
15-
16-
0.2.5
17-
-----
18-
- Jacob Dearing - Kibana looking more Release-Ready :+1:
19-
20-
0.2.4
21-
-----
22-
- Jacob Dearing - Logstash kinda Release-Ready :+1:
23-
24-
0.2.3
25-
-----
26-
- Jacob Dearing - Logstash-Forwarder Release-Ready :+1:
27-
28-
0.2.0
29-
-----
30-
- Jacob Dearing - Pre-Release
31-
32-
- - -
33-
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
34-
35-
The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
1+
# Releases
2+
- [releases]
3+
- [supermarket]
4+
5+
# Change Log
6+
7+
## [v0.3.3]
8+
### Changed
9+
- better config defaults for logstash & logstash-forwader
10+
- logstash-forwarder resource no longer requires a key
11+
- logstash resource now requires both a key and cert
12+
13+
## [v0.3.2]
14+
### Changed
15+
- cosmtic updates
16+
- pinning runit to v1.5.18; see https://github.com/hw-cookbooks/runit/issues/142
17+
18+
## [v0.3.1]
19+
### Submission for feedback
20+
21+
[v0.3.3]: https://github.com/dearing/ellk/compare/v3.2.0...v0.3.3
22+
[v0.3.2]: https://github.com/dearing/ellk/compare/v0.3.2...v0.3.1
23+
[v0.3.1]: https://github.com/dearing/ellk/compare/v0.3.1...v0.3.2
24+
[releases]: https://github.com/dearing/ellk/releases
25+
[supermarket]: https://supermarket.chef.io/cookbooks/ellk

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ About
1818
The heavy lifting comes from [ARK](https://github.com/burtlo/ark) and [RUNIT](https://github.com/hw-cookbooks/runit) cookbooks with a focus around being able to pass optional configurations via merged hashsets for templates and environment variable sets. Meditate on the idea that this library is simply providing a common installation and templating for the 4 projects. It expects you to do all the tweaking and configuring as needed because attempting to account for all is untenable. The opinion is then that you would want logstash-forwarder on all nodes communicating to your logstash endpoints. Logstash-forwarder is overloaded to accept a hash for the logs it will harvert as an attribute making it easy to use in recipes without fumbling with templates. The defaults then expect that logstash would remain resident along all elasticsearch nodes which finally has an interface via kibana. Beyond this, inheriting templates and customizing the configurations and security is up to you.
1919

2020
The default installations are:
21-
```
22-
elasticsearch = 1.7.0 // JAVA
23-
logstash = 1.5.3 // RUBY
24-
logstash-forwarder = 0.4.0 // GO
25-
kibana = 4.1.1 // NODEJS
26-
```
21+
- elasticsearch-1.7.0 *requires java*
22+
- logstash-1.5.3 *requires cert*
23+
- logstash-forwarder-0.4.0 *requires cert*
24+
- kibana-4.1.1
25+
2726
You can override any of these by passing the url for the zip/tar package, a checksum (sha256) and a version to tag is by. See the resource files in the libraries folder for the accepted attributes.
2827

2928
See [ellktest](https://github.com/dearing/ellk/blob/master/test/cookbooks/ellktest/recipes/default.rb) for examples and flexibility..

metadata.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
license 'MIT'
55
description 'Library to handle Elasticsearch, Logstash, Logstash-Forwarder & Kibana'
66
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7-
version '0.3.2'
7+
version '0.3.3'
88

99
%w(ubuntu debian centos redhat amazon scientific oracle enterpriseenterprise).each do |os|
1010
supports os
1111
end
1212

1313
depends 'ark'
14-
depends 'runit', '= 1.5.18' # until https://github.com/hw-cookbooks/runit/issues/142
14+
depends 'runit', '= 1.5.18'

templates/default/logstash/logstash.conf.erb

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,51 @@ input {
1111
}
1212

1313
filter {
14-
## ADD FILTERS HERE
14+
if [type] == "syslog" {
15+
grok {
16+
overwrite => "message"
17+
match => [
18+
"message",
19+
"%{SYSLOGTIMESTAMP:timestamp} %{IPORHOST:host} (?:%{PROG:program}(?:\[%{POSINT:pid}\])?: )?%{GREEDYDATA:message}"
20+
]
21+
}
22+
syslog_pri { }
23+
date {
24+
# season to taste for your own syslog format(s)
25+
match => [
26+
"timestamp",
27+
"MMM d HH:mm:ss",
28+
"MMM dd HH:mm:ss",
29+
"ISO8601"
30+
]
31+
}
32+
}
33+
34+
if [type] == "apache-access" {
35+
grok {
36+
patterns_dir => ["./config/patterns"]
37+
match => ["message", "%{COMBINEDAPACHELOG}" ]
38+
}
39+
date {
40+
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z", "dd/MMM/yyyy:HH:mm:ss" ]
41+
}
42+
}
43+
44+
if [type] == "nginx-access" {
45+
grok {
46+
patterns_dir => ["./config/patterns"]
47+
match => ["message", "%{NGINXACCESS}" ]
48+
}
49+
date {
50+
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z", "dd/MMM/yyyy:HH:mm:ss" ]
51+
}
52+
}
1553
}
1654

55+
1756
# TODO: logstash doesn't convert 1:1 with ruby or json, hash passing will have to wait
1857
# for now we consider all elasticsearch nodes have a logstash service on the same machine
1958
output {
2059
elasticsearch { host => localhost}
21-
stdout { codec => rubydebug }
60+
stdout { codec => json }
2261
}

test/cookbooks/ellktest/recipes/default.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
to '/usr/bin/sv'
2323
end
2424

25-
# create certs (subject = localhost)
25+
# create certs (SN = localhost)
2626
secrets = Chef::DataBagItem.load('secrets', 'logstash')
2727
logstash_key = Base64.decode64(secrets['key'])
2828
file '/tmp/logstash.key' do
@@ -55,9 +55,8 @@
5555
## LOGSTASH-FORWARDER
5656
logstash_forwarder 'default' do
5757
crt_location '/tmp/logstash.crt'
58-
# key_location '/tmp/logstash.key'
5958
logstash_servers ['localhost:5043']
60-
files [{ 'paths' => ['/var/log/messages', '/var/log/*log', '/var/log/kibana/current'], 'fields' => { 'type' => 'syslog' } }]
59+
files [{ 'paths' => ['/var/log/messages', '/var/log/*log'], 'fields' => { 'type' => 'syslog' } }]
6160
end
6261

6362
## KIBANA

test/cookbooks/ellktest/templates/default/logstash/logstash.conf.erb

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,31 @@ input {
1111
}
1212

1313
filter {
14-
if [type] == "syslog" {
14+
if [type] == "syslog" {
1515
grok {
16-
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
17-
add_field => [ "received_at", "%{@timestamp}" ]
18-
add_field => [ "received_from", "%{host}" ]
16+
overwrite => "message"
17+
match => [
18+
"message",
19+
"%{SYSLOGTIMESTAMP:timestamp} %{IPORHOST:host} (?:%{PROG:program}(?:\[%{POSINT:pid}\])?: )?%{GREEDYDATA:message}"
20+
]
1921
}
2022
syslog_pri { }
2123
date {
22-
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
24+
# season to taste for your own syslog format(s)
25+
match => [
26+
"timestamp",
27+
"MMM d HH:mm:ss",
28+
"MMM dd HH:mm:ss",
29+
"ISO8601"
30+
]
2331
}
2432
}
2533
}
2634

35+
2736
# TODO: logstash doesn't convert 1:1 with ruby or json, hash passing will have to wait
2837
# for now we consider all elasticsearch nodes have a logstash service on the same machine
2938
output {
3039
elasticsearch { host => localhost}
31-
stdout { codec => rubydebug }
32-
}
40+
stdout { codec => json }
41+
}

0 commit comments

Comments
 (0)