Last active
March 27, 2019 01:38
-
-
Save peacefixation/7bc65b72f0770c98035b7e1e23ccf894 to your computer and use it in GitHub Desktop.
Test logstash filter with an input file
This file contains hidden or 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
| # test.conf | |
| input { | |
| file { | |
| path => "/tmp/some-file.log" | |
| start_position => beginning | |
| sincedb_path => "/dev/null" | |
| type => "some-type" | |
| } | |
| } | |
| filter { | |
| # Handles unprocessed entries | |
| if [type] == "some-type" { | |
| if "processed" not in [tags] { | |
| add_tag => [ "processed" ] | |
| } | |
| } | |
| } | |
| output { | |
| stdout { codec => json } | |
| } | |
| # validate | |
| /usr/share/logstash/bin/logstash --path.settings /etc/logstash -f /tmp/test.conf --debug -t | |
| # run | |
| /usr/share/logstash/bin/logstash --path.settings /etc/logstash -f /tmp/test.conf --debug | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment