Summary: I have my log with the date format as shown :
2013/05/09-05:19:16.772
Now I want to use logstash and send these logs to elastic search. But the problem is that I want that the timestamp value should be that of the logs and not the current time.
Therefore, I have written the following. This fails saying this:
Invalid format: "2013/05/09-05:19:16.876" is malformed at "/05/09-05:19:16.876", :backtrace=>["org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:866)"
My conf file is:
input {
stdin {
type => "stdin-type"
}
}
filter {
grok {
type => "stdin-type"
patterns_dir=>["./patterns"]
pattern => "%{PARSE_ERROR}"
add_tag=>"%{type1},%{type2},%{slave},ERR_SYSTEM"
}
date {
type => "stdin-type"
match=>["ts","yyyy/mm/dd-HH:mm:ss.SSS"]
locale=>"en"
}
mutate {
type=>"stdin-type"
replace => ["@message", "%{message}" ]
replace => ["@timestamp", "%{ts}" ]
}
}
output {
stdout { debug => true debug_format => "json"}
elasticsearch { }
}
I am really stuck here. Need some expert help.
Thanks.