Since your month is in abbreviated form, you will have to use MMM
Refer to this for more detailed information about the date plugin.
match => [ "logdate", "MMM dd, yyyy HH:mm:ss.SSSSSSSSS ZZZ" ]
Also, I suggest you start set the logging level to debug in the logstash.yml and restart the server and also have stdout {} in the output to debug your config further. The stdout messages would be visible in the journalctl output.
But just out of curiosity, how did you know that the month is abbreviated? I only have data from May. And i'm not sure about its abbreviated form. wouldn't it still be the same?
Yeah, for May, MMMM and MMM should not ideally make any difference. I guess you'll have to figure that out from the logstash logs about which one is correct.
The line with the column starting with "Request: 2 ID" is incorrectly quoted. Each column value is surrounded by a double qoute, but then any internal double quotes in the column values must be escaped, i.e.
Thank you. I will track that down to the tool generating the logs.
But I don't think that's the issue with the date. since only a small portion of the logs have this issue (at least that's what i can tell from the logstash logs) . However, I don't see an error related to date parsing
Yet the date is still parsed as string from some reason.
Are you talking about the data type in the Elasticsearch index? Because that's a completely different thing. ES will recognize field values produced by the date filter as a date and map the field as that data type, but that only happens the first time a document with a field with that name is seen by the index. If you're still just playing around you can just delete the index and make Logstash process the data again.
The date filter's parsing of the logdate field failed, hence the _dateparsefailure tag and the wrong data type of the field in ES. Your timestamp doesn't include the year so remove "yyyy" from your date patterns.
But two questions remains,
1- Why the field type is still a string in the db?
2- Why the original pattern is not parsing the original timestamp (since i have to revert to the original - this format was just for debugging)
Did you drop the ES index? If you're looking in Kibana, did you refresh the field list?
Why the original pattern is not parsing the original timestamp (since i have to revert to the original - this format was just for debugging)
I'm not sure SSSSSSSSS is able to parse microseconds. I also don't think ZZZ can parse timezone names like EEST. But again: If the date filter fails the Logstash log will contain details about the failure.
This will not help solve the issue, but just a useful tip to make debugging easier...
Have stdin {} as your input plugin and stdout {} in your output plugin.
Stop the logstash service.
Try starting the server manually like this to get the parsed output on the console: echo "<a single line from your .csv>" | <logstash executable path> --path.settings <logstash config directory> -f <pipeline config file path> --debug
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.