I have no idea how to match my TimeStamp. Could someone please help me?
Example of my TimeStamps from Apache Log: "2016-06-13T14:54:39.000+0100"
filter { if [type] == "apache" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" } }
date {
timezone => "UTC"
match => [ "timestamp" , "yyyy-mm-ddTHH:mm:ss Z"]
} } }
output { stdout { codec => rubydebug } }
Output:
{:timestamp=>"2016-06-13T14:56:43.196000+0100", :message=>"Error: Cannot register filter date plugin. The error reported is: \n Illegal pattern component: T for pattern 'yyyy-mm-dd\THH:mm:ss Z'", :level=>:error}
Apache Log Example:
{ "@version": "1", "@timestamp": "2016-06-14T09:11:23.000+0100", "message": "GET /page1/page2/ HTTP/1.1", "via": "192.168.1.1", "client-ip": "192.168.1.23", "remote-logname": "-", "remote-user": "-", "recv-time": "[14/Jun/2016:09:11:23 +0100]", "serve-time-microsec": "85471", "request": "GET /page1/page2/ HTTP/1.1", "status": "200", "size": "79648", "referer": "http://www.google.com/", "user-agent": "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13", "url": "/page1/page2/", "query": "", "method": "GET", "protocol": "HTTP/1.1", "vhost": "www.site.com", "received-size": "998" }
2016-06-13T14:54:39.000+0100
– NarayanaCOMBINEDAPACHELOG
which uses date format%{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{INT}
. – ItayDyyyy-MM-dd'T'HH:mm:ss.SSSZ
– ItayD