I am having a devil of a time figuring out how to configure my Logstash filter options to correctly parse the timestamp from the event into the @timestamp field.
Im sure im doing something wrong that is simple, I just cant see it. Each time I enter sample input The @timestamp value does not update correctly. any help would be appreciated
Test config:
input { stdin {} }
filter{
if [type] == "ssl_request" { grok{ match => [ "message", '\[%{HTTPDATE:timestamp}\] %{IPORHOST:client} %{NOTSPACE:protocol} %{NOTSPACE:cipher} "(%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})"'] } date { match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] target => "@timestamp" } }
}
output {
stdout {codec => json }
}
test input:
[02/JAN/2017:01:29:45 -0500] 10.1.1.1 TLSv1 RC4-SHA "POST /path/2/webservice/url HTTP/1.1" 27
output:
Pipeline main started
[02/JAN/2017:01:29:45 -0500] 10.1.1.1 TLSv1 RC4-SHA "POST /path/2/webservice/url HTTP/1.1" 27
{"message":"[02/JAN/2017:01:29:45 -0500] 10.1.1.1 TLSv1 RC4-SHA "POST /path/2/webservice/url HTTP/1.1" 27","@version":"1","@timestamp":"2017-02-02T17:13:46.383Z","host":"server_name"}[02/JAN/2017:01:29:45 -0500] 10.1.1.1 TLSv1 RC4-SHA "POST /path/2/webservice/url HTTP/1.1" 27
{"message":"[02/JAN/2017:01:29:45 -0500] 10.1.1.1 TLSv1 RC4-SHA "POST /path/2/webservice/url HTTP/1.1" 27","@version":"1","@timestamp":"2017-02-02T17:13:54.207Z","host":"server_name"}