-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why is logstash parsing the year only as 2-digit? #67
Comments
Please join us in #logstash on Freenode or at https://discuss.elastic.co/ for troubleshooting help, we reserve Github for confirmed bugs and feature requests :) |
Thanks for your response. Well, I figured it out by constructing the mentioned work around so i'm not really seeking for troubleshooting help. |
Ok, apologies if I misunderstood! :) |
@csamsel This looks to me like a bug, I need to run a bit more rest, but a quick run of the YEAR expression at rubular.com matched for the 4 digits, so I would call it a bug for now. Thanks a lot for your time and report! |
Hi @csamsel I was doing more test on your issue, specially with the DATESTAMP and seeing the output of the grok, all worked for me as expected. would you be able to provide me a sample log line? this would be super useful to actually validate if this is a grok error or a multiline one. Thanks |
Hi, Here is an (anonymized) log excerpt. All lines are related to the same query and therefore are useful to multiline. I'm correlating them by the same timestamp, which did not work initially because the leading 20 is not parse by grok.
looking at the pattern
it should allow either 2 or 4 diggits, but it only parses 2. Just check your own data if the timestamp is save as e.g. 15-09-09 08:45:49.644 UTC or 2015-09-09 08:45:49.644 UTC (the latter beeing prefered) |
I noticed that datestamp for some reason is parsing the first number as a MONTH as first priority, DAY as second priority (Because of DATE_US/DATE_EU), but never parses it as YEAR first. If you pass 2002/01/14, it parses it as 02 MONTH, 01 DAY, 14 YEAR. If you pass 2015/01/14 it parses as 15 DAY, 01 MONTH, 14 YEAR. but it'll never parse it as YEAR, MONTH, DAY. It would be nice to have a built-in that parses YEAR/MONTH/DAY as it's mentioned in grok-patterns
Right now, DATESTAMP only works with MM/DD/YYYY or DD/MM/YYYY patterns. |
confirming what xNinjaKitty says. The comment about accepted datestamp formats doesn't include year-first. In fact, there's no YYYY/mm/dd format (with slashes). This is the cause of #112. |
I was using the following snippet to parse a customized size postgres logfile:
which worked very well. As it turned out, sometimes postgres is using multiline, so my first shot was:
which did not work. Looking at the JSON i found:
"timestamp_psql": "15-07-10 09:31:57.030 UTC",
so the leading 20 is discarded. I mean, for most logfiles this should be totally fine, but for me it was very confusing. I guess grok somehow ignores leading and trailing data for pattern matching.
Im now using
as multiline filter (it works). but still thats wierd.
The text was updated successfully, but these errors were encountered: