diff --git a/README.md b/README.md index 4348930..6f9123f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# The LogStash Book Code Repository +# The Logstash Book Code Repository -Contains the code and configuration examples from [The LogStash +Contains the code and configuration examples from [The Logstash Book](http://www.logstashbook.com). -*Now updated for LogStash v1.2.0.* +*Now updated for Logstash v1.3.2.* ## Errata diff --git a/code/2/sample.conf b/code/2/sample.conf index dea10e8..d290822 100644 --- a/code/2/sample.conf +++ b/code/2/sample.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { diff --git a/code/3/central.conf b/code/3/central.conf index 40e46db..4d4014d 100644 --- a/code/3/central.conf +++ b/code/3/central.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { diff --git a/code/3/logstash-agent-init b/code/3/logstash-agent-init index 0ad1561..1110766 100644 --- a/code/3/logstash-agent-init +++ b/code/3/logstash-agent-init @@ -1,5 +1,5 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # # diff --git a/code/3/logstash-central-init b/code/3/logstash-central-init index 6217d07..883007a 100644 --- a/code/3/logstash-central-init +++ b/code/3/logstash-central-init @@ -1,6 +1,6 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # diff --git a/code/3/logstash-web-init b/code/3/logstash-web-init index b5e03f3..89bd54c 100644 --- a/code/3/logstash-web-init +++ b/code/3/logstash-web-init @@ -1,6 +1,6 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # diff --git a/code/3/shipper.conf b/code/3/shipper.conf index 1cc5416..99889b6 100644 --- a/code/3/shipper.conf +++ b/code/3/shipper.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { diff --git a/code/4/logstash_forwarder_debian_defaults b/code/4/logstash_forwarder_debian_defaults index 1b0f28a..a09fa88 100644 --- a/code/4/logstash_forwarder_debian_defaults +++ b/code/4/logstash_forwarder_debian_defaults @@ -1,5 +1,5 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # -# Options for the LogStash Forwarder +# Options for the Logstash Forwarder LOGSTASH_FORWARDER_OPTIONS="-config /etc/logstash-forwarder/logstash-forwarder.conf" diff --git a/code/4/logstash_forwarder_debian_init b/code/4/logstash_forwarder_debian_init index 6d65bad..8a4abc2 100644 --- a/code/4/logstash_forwarder_debian_init +++ b/code/4/logstash_forwarder_debian_init @@ -1,6 +1,6 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # diff --git a/code/4/logstash_forwarder_redhat_init b/code/4/logstash_forwarder_redhat_init index d75b6f4..c6c54c9 100644 --- a/code/4/logstash_forwarder_redhat_init +++ b/code/4/logstash_forwarder_redhat_init @@ -1,5 +1,5 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # # logstash-forwarder Start/Stop logstash-forwarder diff --git a/code/4/logstash_forwarder_redhat_sysconfig b/code/4/logstash_forwarder_redhat_sysconfig index 1b0f28a..a09fa88 100644 --- a/code/4/logstash_forwarder_redhat_sysconfig +++ b/code/4/logstash_forwarder_redhat_sysconfig @@ -1,5 +1,5 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # -# Options for the LogStash Forwarder +# Options for the Logstash Forwarder LOGSTASH_FORWARDER_OPTIONS="-config /etc/logstash-forwarder/logstash-forwarder.conf" diff --git a/code/4/lumberjack-debian-defaults b/code/4/lumberjack-debian-defaults index 0bb9ac2..98afe51 100644 --- a/code/4/lumberjack-debian-defaults +++ b/code/4/lumberjack-debian-defaults @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # # Options for lumberjack diff --git a/code/4/lumberjack-debian-init b/code/4/lumberjack-debian-init index 3e85b7d..f10ef4c 100644 --- a/code/4/lumberjack-debian-init +++ b/code/4/lumberjack-debian-init @@ -1,6 +1,6 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # diff --git a/code/4/lumberjack-redhat-init b/code/4/lumberjack-redhat-init index 1cfaf6b..dc936df 100644 --- a/code/4/lumberjack-redhat-init +++ b/code/4/lumberjack-redhat-init @@ -1,5 +1,5 @@ #! /bin/sh -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # # lumberjack Start/Stop lumberjack diff --git a/code/4/lumberjack-redhat-sysconfig b/code/4/lumberjack-redhat-sysconfig index 0bb9ac2..98afe51 100644 --- a/code/4/lumberjack-redhat-sysconfig +++ b/code/4/lumberjack-redhat-sysconfig @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # # Options for lumberjack diff --git a/code/5/apache_log.conf b/code/5/apache_log.conf index 6df992b..35e97fa 100644 --- a/code/5/apache_log.conf +++ b/code/5/apache_log.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # LogFormat "{ \ diff --git a/code/5/central.conf b/code/5/central.conf index 40e46db..4d4014d 100644 --- a/code/5/central.conf +++ b/code/5/central.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { diff --git a/code/5/postfix_patterns b/code/5/postfix_patterns index f1c9757..5b7bb9d 100644 --- a/code/5/postfix_patterns +++ b/code/5/postfix_patterns @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # diff --git a/code/5/shipper.conf b/code/5/shipper.conf index 638e280..d97fc5e 100644 --- a/code/5/shipper.conf +++ b/code/5/shipper.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { @@ -54,6 +54,18 @@ filter { timezone => tz add_tag => [ "dated" ] } + if [apprelease] == "QA Release" { + mutate { + add_field => [ "environment", "qa" ] + } + else { + mutate { + add_field => [ "environment", "production" ] + } + } + mutate { + convert => [ "line", "integer" ] + } } } output { diff --git a/code/6/shipper.conf b/code/6/shipper.conf index 638e280..d97fc5e 100644 --- a/code/6/shipper.conf +++ b/code/6/shipper.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { @@ -54,6 +54,18 @@ filter { timezone => tz add_tag => [ "dated" ] } + if [apprelease] == "QA Release" { + mutate { + add_field => [ "environment", "qa" ] + } + else { + mutate { + add_field => [ "environment", "production" ] + } + } + mutate { + convert => [ "line", "integer" ] + } } } output { diff --git a/code/7/central.conf b/code/7/central.conf index db77b15..e5e7be1 100644 --- a/code/7/central.conf +++ b/code/7/central.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { diff --git a/code/7/shipper.conf b/code/7/shipper.conf index 638e280..d97fc5e 100644 --- a/code/7/shipper.conf +++ b/code/7/shipper.conf @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # input { @@ -54,6 +54,18 @@ filter { timezone => tz add_tag => [ "dated" ] } + if [apprelease] == "QA Release" { + mutate { + add_field => [ "environment", "qa" ] + } + else { + mutate { + add_field => [ "environment", "production" ] + } + } + mutate { + convert => [ "line", "integer" ] + } } } output { diff --git a/code/8/cowsay.rb b/code/8/cowsay.rb index 0e47c5d..9f1e846 100644 --- a/code/8/cowsay.rb +++ b/code/8/cowsay.rb @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # require "logstash/outputs/base" diff --git a/code/8/namedpipe.rb b/code/8/namedpipe.rb index ffa628c..87d0f17 100644 --- a/code/8/namedpipe.rb +++ b/code/8/namedpipe.rb @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # require 'logstash/namespace' diff --git a/code/8/suffix.rb b/code/8/suffix.rb index 444292d..7570883 100644 --- a/code/8/suffix.rb +++ b/code/8/suffix.rb @@ -1,4 +1,4 @@ -# From The LogStash Book +# From The Logstash Book # The original of this file can be found at: http://logstashbook.com/code/index.html # require "logstash/filters/base"