Logstash uses the locale when parsing names of months. What's the system's locale? If other than English you should to add locale => "en" to your date filter.
ok i already checked it, it's set to LANG=en_US.UTF-8
I also found our suggestion in another thread and setting the locale in the config did not work for me.
I have exactly the same issue. But the solution from alex22 doesn't work for me.
Here is my config:
filter {
if [type] == "apache-access" {
grok {
match => { "rawmsg" => "%{COMBINEDAPACHELOG}" }
}
date {
locale => "en"
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
}
}
}
This is the error from logstash:
"error"=>{
"type"=>"mapper_parsing_exception",
"reason"=>"failed to parse [timestamp]",
"caused_by"=>{
"type"=>"illegal_argument_exception",
"reason"=>"Invalid format: \"02/Feb/2016:08:22:19 +0100\" is malformed at \"/Feb/2016:08:22:19 +0100\""
}
}
I use logstash 2.1.1 and ElasticSearch 2.1.1. I've cleaned the ElasticSearch index as suggested by Alex22, but this doesn't help in my case.
If I search through the internet, then I've found a lot of similar issues. These issues were solved by adding the local to the date filter. But in my case that doesn't help. There is also a difference in the error message. The issue wich could be solved with the local, has an error message in the form "is malformed at "Feb/2016:08:22:19 +0100"", which indicates that the month couldn't be parsed. But my error message indicates that the date couldn't be parsed at the leading slash.
The timestamp field has, for some reason, been mapped as a date in Elasticsearch, but the timestamp string parsed from the HTTP log doesn't follow that pattern. Since you'll be parsing the timestamp into the @timestamp field anyway you might as well delete the timestamp field which should get rid of the error above.
date {
locale => "en"
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
remove_field => ["timestamp"]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.