I have flat file(jobs.log) which has below data
2016-05-25 17:52:11,467 [INFO ] [main] [FileName.java:50] - Application: abc Rule: 123 Status: SUCCESS
I want log time stamp to show in kibana, so I am trying to replace @timestamp with log date time. I am using below config file
input{
# Read from flat file
file{
path => "\mypath\jobs.log"
start_position => beginning
ignore_older => 0
}
}
filter{
# check for patterns via grok plugin
grok{
match => { "message" => "%{TIMESTAMP_ISO8601:formattedDate}* Application: %{DATA:applicationId} Rule: %{WORD:ruleName} Status: %{WORD:status}"}
}
#date{
#match => [ "formattedDate","YYYY-MM-dd HH:mm:ss,SSS", "ISO8601"]
#locale => "en"
#target => "@timestamp"
#}
}
output{
elasticsearch {}
stdout { codec => rubydebug}
}
On my console formattedDate is not printing. Output is:
{
"message" => "2016-05-25 17:52:11,467 [INFO ] [main] [FileName.java:50] - Application: abc Rule: 123 Status: SUCCESS",
"@version" => "1",
"@timestamp" => "2016-05-27T18:28:04.559Z",
"path" => "\mypath\jobs.log",
"host" => "hostName",
"applicationId" => "abc",
"ruleName" => "123",
"status" => "SUCCESS"
}
How can I get timestamp replaced with log file timestamp?