Hi everyone,
I'm using logstash to manage my catalina logs.
The issue I encounter is the fact that I have to type of timestamp in my logs.
- 2017-04-04 10:16:54,297
- 04-Apr-2017 10:16:54.443
Here my filter configuration
filter {
if [type] == "catalina"{
if [message] !~ /(.+)/ {
drop { }
}
grok {
match => [
"message", "%{TOMCAT_DATESTAMP2:timestamp} %{GREEDYDATA:ActiveThread} %{LOGLEVEL:loglevel} %{USERNAME:auth}? %{USERNAME:ident}? %{USERNAME:ident}? %{IP:clientip}? %{NOTSPACE:request}? [%{GREEDYDATA:service}] %{GREEDYDATA:message}",
"message", "%{DATESTAMP2:timestamp} %{LOGLEVEL:loglevel} [%{NOTSPACE:service}] %{GREEDYDATA:message}"
]
}
date {
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss,SSS" ]
target => "@timestamp"
}
}
}
For my fisrt type of timestamp, I don't have any issue but for the second one I always get the tag _dateparsefailure.
Then I'm trying to find a way to convert 04-Apr-2017 to 2017-04-04 to avoid this failure.
Any ideas?
Thank you for your help.