discrepency between grok pattern TIMESTAMP_ISO8601 and ISO8601 in date filter
I'm trying to import a log (elasticsearch incidentally...) which has a log format like this:
[2014-06-20 07:30:05,987][INFO ][snapshots ] [es101] snapshot [backup:kibana-20140620073002] is done
This is my filter:
grok {
match => [
"message", "\[%{TIMESTAMP_ISO8601:timestamp}\]\[%{DATA:level}\s*\]\[%{DATA:loggerName}\]\s*\[%{DATA:machineName}\] %{GREEDYDATA:message}"
]
overwrite => [ "message" ]
}
date {
match => [ "timestamp", "ISO8601" ]
remove_field => [ "timestamp" ]
}
The grok matches the timestamp, but the date filter does not...
I can make it work by replacing the date filter with this:
date {
match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS" ]
remove_field => [ "timestamp" ]
}
Seems that these could/should be homogeneous...
Cheers! -Robin-
Background information in LOGSTASH-180 jira ticket in particular in this comment
Also solution proposal in #769
where are these pattern names like "ISO8601" defined?
@bpesics I suppose you seek the definition in logstash grok patterns that allows either a space or a T
https://github.com/elasticsearch/logstash/blob/master/patterns/grok-patterns#L68
otherwise you need to know that the date filter internally use jodatime, and have a look to http://joda-time.sourceforge.net/cal_iso.html
HTH
or simply the documentation of the date filter match config http://logstash.net/docs/1.4.2/filters/date#match
thanks, i've seen that just overlooked it ;-)
On Wed, Jul 23, 2014 at 1:10 PM, Wiibaa [email protected] wrote:
or simply the documentation of the date filter *match config * http://logstash.net/docs/1.4.2/filters/date#match
— Reply to this email directly or view it on GitHub https://github.com/elasticsearch/logstash/issues/1464#issuecomment-49865123 .
It's rough that the date filter fails silently. grok adds a _grokparsefailure tag when it fails - Could the date similarly add a _dateparsefailure when the date fails to parse?
edit - added #1615 rather than continuing to threadjack this issue.
Closed via https://github.com/elasticsearch/logstash/pull/769
Seems the pattern accepts a comma separator before fractions of a second, but ISO1806 match does not. Had to explicitly use "YYYY-MM-dd HH:mm:ss,SSS" as my match. Using logstash 1.5.4
Sorry, but why is this closed? The date filter still doesn't accept a comma between the time element and its fraction when using "ISO8601" (https://en.wikipedia.org/wiki/ISO_8601#cite_ref-15). Or are you saying the Yoda implementation is wrong and you can do nothing about this?
@rawbertp from a quick look to joda, it should be accepting either dot or comma but it enforces the use of 'T' and reject the space, please upvote https://github.com/logstash-plugins/logstash-filter-date/issues/32 and manually define your date pattern in the date filter configuration as a workaround