Skip to content

Instantly share code, notes, and snippets.

@gelim
Last active May 26, 2016 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gelim/ea9ab569ea9d18e8b145 to your computer and use it in GitHub Desktop.
Save gelim/ea9ab569ea9d18e8b145 to your computer and use it in GitHub Desktop.
logstash date filter (nginx)
$ logstash -f test.conf
$ echo '{"ts": "03/Sep/2014:16:11:58 +0200", "foo": "bar"}' | nc localhost 2222
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