Last active
May 26, 2016 21:38
-
-
Save gelim/ea9ab569ea9d18e8b145 to your computer and use it in GitHub Desktop.
logstash date filter (nginx)
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
$ logstash -f test.conf | |
$ echo '{"ts": "03/Sep/2014:16:11:58 +0200", "foo": "bar"}' | nc localhost 2222 |
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
input { | |
tcp { | |
port => 2222 | |
codec => "json" | |
} | |
} | |
filter { | |
date { | |
match => [ "ts", "dd/MMM/YYYY:HH:mm:ss Z" ] | |
locale => "en" | |
} | |
} | |
output { | |
stdout { codec => "json" } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment