forked from cloudfoundry-community/logsearch-boshrelease
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow disabling default elasticsearch output for parser job
Fix for cloudfoundry-community#8. Property 'logstash_parser.outputs' is set with list of logstash output plugins, by default it is set to 'elasticsearch' plugin. Rename 'logstash_parser' elasticsearch properties to follow the same naming convention - 'logstash_parser.elasticsearch.*'. Add logstash-templates tests to test input_and_output.conf.erb template with different configurations. Minor reqork in test scripts - all tests are run with default rake task. Use FileUtils.* methods in Rakefile 'cleanup' tasks.
- Loading branch information
1 parent
e77c9d5
commit 5e1fbea
Showing
23 changed files
with
399 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 13 additions & 9 deletions
22
src/logsearch-config/test/logstash-templates/input_and_output/test_default-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
--- | ||
# -- | ||
# Required properties are set + default values (see "parser" job spec for default values). | ||
# -- | ||
properties: | ||
logstash_parser: | ||
debug: false | ||
inputs: [ { plugin: "redis", options : {} } ] | ||
elasticsearch_document_id: ~ | ||
elasticsearch_index: "logs-%{[@metadata][index]}-%{+YYYY.MM.dd}" | ||
elasticsearch_index_type: "%{@type}" | ||
logstash: | ||
output: | ||
elasticsearch: | ||
data_hosts: [127.0.0.1] | ||
flush_size: 500 | ||
outputs: [ { plugin: "elasticsearch", options: {} } ] | ||
elasticsearch: | ||
document_id: ~ | ||
index: "logs-%{[@metadata][index]}-%{+YYYY.MM.dd}" | ||
index_type: "%{@type}" | ||
idle_flush_time: 100 | ||
data_hosts: [127.0.0.1] | ||
flush_size: 500 | ||
redis: | ||
# required, non-default | ||
host: 127.0.0.1 | ||
|
||
port: 6379 | ||
key: logstash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
src/logsearch-config/test/logstash-templates/input_and_output/test_enabled_debug-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ogsearch-config/test/logstash-templates/input_and_output/test_enabled_debug-expected.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
input { | ||
redis { | ||
host => "127.0.0.1" | ||
host => "127.0.0.1" | ||
port => 6379 | ||
type => "redis-input" | ||
data_type => "list" | ||
|
18 changes: 18 additions & 0 deletions
18
src/logsearch-config/test/logstash-templates/input_and_output/test_inputs-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -- | ||
# Default values + additional inputs. | ||
# -- | ||
properties: | ||
logstash_parser: | ||
debug: false | ||
inputs: [ { plugin: "redis", options : {} }, { plugin: "file", options: { path: "my/path/to/file" } }, { plugin: "syslog", options: { host: "127.0.0.1", port: 123} } ] | ||
outputs: [ { plugin: "elasticsearch", options: {} } ] | ||
elasticsearch: | ||
document_id: ~ | ||
index: "logs-%{[@metadata][index]}-%{+YYYY.MM.dd}" | ||
index_type: "%{@type}" | ||
data_hosts: [127.0.0.1] | ||
flush_size: 500 | ||
redis: | ||
host: 127.0.0.1 | ||
port: 6379 | ||
key: logstash |
29 changes: 29 additions & 0 deletions
29
src/logsearch-config/test/logstash-templates/input_and_output/test_inputs-expected.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
input { | ||
redis { | ||
host => "127.0.0.1" | ||
port => 6379 | ||
type => "redis-input" | ||
data_type => "list" | ||
key => "logstash" | ||
threads => 8 | ||
} | ||
|
||
file { | ||
path => "my/path/to/file" | ||
} | ||
|
||
syslog { | ||
host => "127.0.0.1" | ||
port => 123 | ||
} | ||
} | ||
|
||
output { | ||
elasticsearch { | ||
hosts => ["127.0.0.1:9200"] | ||
flush_size => 500 | ||
index => "logs-%{[@metadata][index]}-%{+YYYY.MM.dd}" | ||
document_type => "%{@type}" | ||
manage_template => false | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...logsearch-config/test/logstash-templates/input_and_output/test_inputs_no_redis-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -- | ||
# Default values + additional inputs. | ||
# -- | ||
properties: | ||
logstash_parser: | ||
debug: false | ||
inputs: [ { plugin: "file", options: { path: "my/path/to/file" } }, { plugin: "syslog", options: { host: "127.0.0.1", port: 123} } ] | ||
outputs: [ { plugin: "elasticsearch", options: {} } ] | ||
elasticsearch: | ||
document_id: ~ | ||
index: "logs-%{[@metadata][index]}-%{+YYYY.MM.dd}" | ||
index_type: "%{@type}" | ||
data_hosts: [127.0.0.1] | ||
flush_size: 500 | ||
redis: | ||
host: 127.0.0.1 | ||
port: 6379 | ||
key: logstash |
Oops, something went wrong.