Hello Folks...
i am sorry for that Question, i saw a lot of topics about the same problem, but there isn't one which is helpfull in my case.
In Logstash i would like to parse my timestamp to @timestamp but i receive a _dateparsefailure.
This is my Log: 129.70.76.43 - - [03/Jan/2017:14:39:38 +0100] "GET /resources/mail.png HTTP/1.1" 304 181 "http://www.jrabar.kuchen/qukkkkkkmaneeent/weirtecung-rofldiekatz.html" "Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0"
This is my config for Logstash:
...input ....
filter {
if [type] == "apache-access" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
date {
match => [ "timestamp", "dd/MM/YYYY:HH:mm:ss Z" ]
}
}
}
output {
stdout { }
elasticsearch {
}
}
I know, that my Logfile has three letters for the month. Shouldn't be the matching option something like this? match => [ "timestamp", "dd/**MMM**/YYYY:HH:mm:ss Z" ]
If i use MMM, i receive a _grokeparsingfailure
Can someone give me a hint?
For my understanding: parsing the timestamp with date is usefull, so the date of the event in the log will be the same as in elasticsearch. Furthermore, it gives me the possibilty to search with it, am I right?
In addition, is there somewhere a videotutorial about "how to use grok/how to parse and index logs"? For me, all the regular expressions are looking highly complicated. Even with my "Logstash"-Book and the Grok Debugger i am feeling like "bruteforcing" a correct configuration for the filter.
I know, that my Logfile has three letters for the month. Shouldn't be the matching option something like this?
Yes, you need MMM.
If i use MMM, i receive a _grokeparsingfailure
No. Changing the date filter configuration does not affect the preceding grok filter. Show us the event that got the _grokparsefailure tag. You can copy/paste from the JSON tab in Kibana.
Are you looking at the correct date range in Kibana? Are you sure they aren't ending up in the wrong index? Is there anything interesting in the Logstash logs?
Some logs were wrong and thats the reason why I only saw the "_grokparsedfailure"-logs in kibana. Because of that, I thought I did a mistake.
In addition, the timestamp is working for the right-parsed files.
Thank you very much for your fast respond and sorry for "spaming" the forum with thislow-level issue.
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.