Date match failure failure with given format


I am getting below error in ES logs.
This is related to the match failure. I don't how it appears in ES?

[2017-05-08 10:30:19,469][WARN ][indices.cluster          ] [data-node-3] [[esb-2017.05.08][0]] marking and sending shard failed due to [engine failure, reason [indices:data/write/bulk[s] failed on replica]]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [eventLogTime]
  at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(
    at org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(
    at org.elasticsearch.index.mapper.object.ObjectMapper.parse(
    at org.elasticsearch.index.mapper.DocumentMapper.parse(
    at org.elasticsearch.index.mapper.DocumentMapper.parse(
    at org.elasticsearch.index.shard.IndexShard.prepareCreate(
    at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnReplica(
    at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
Caused by: org.elasticsearch.index.mapper.MapperParsingException: failed to parse date field [5/8/17 10:30:11:094 EEST], tried both date format [dateOptionalTime], and timestamp number with locale []
    at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(
    at org.elasticsearch.index.mapper.core.DateFieldMapper.innerParseCreateField(
    at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(
    at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(
    ... 13 more
Caused by: java.lang.IllegalArgumentException: Invalid format: "5/8/17 10:30:11:094 EEST" is malformed at "/8/17 10:30:11:094 EEST"
    at org.elasticsearch.common.joda.time.format.DateTimeParserBucket.doParseMillis(
    at org.elasticsearch.common.joda.time.format.DateTimeFormatter.parseMillis(
    at org.elasticsearch.index.mapper.core.DateFieldMapper.parseStringValue(
    ... 16 more

Log data is :[5/8/17 10:38:55:422 EEST] 00000035 JDBCRAResourc I JDBCManagedConnection getWBIConnection Database connection in 'DataSource JNDI' mode is created successfully!

I have date match filter in logstash:
match => [ "eventLogTime", "YYYY-MM-dd'T'HH:mm:ss", "YYYY-MM-dd HH:mm:ss","HH:mm:ss MMM dd yyyy","YYYY-MM-dd HH:mm:ss,SSS","yyyy.MM.dd G 'at' HH:mm:ss z","yyyyy.MMMMM.dd GGG hh:mm aaa","EEE, d MMM yyyy HH:mm:ss Z","yyyy-MM-dd'T'HH:mm:ss.SSSZ","yyyy-MM-dd'T'HH:mm:ss.SSSZ+0300","YYYY-MM-dd HH:mm:ss.SSS","YYYY-MM-dd HH:mm:ss.S","dd/MMM/yyyy:HH:mm:ss Z","YYYY-MM-dd'T'HH:mm:ss+02:00","yyyy/MM/dd HH:mm:ss","YYYY-MM-dd'T'HH:mm:ss+03:00","ISO8601","YYYY-MM-dd-HH:mm:ss.SSSZ","MMM dd HH:mm:ss","dd.MM.YYYY HH:mm:ss:SSS"]

I don't know what pattern to add in the date match filter.

The date filter can't parse timezone names like EEST, but you can use a translate filter to map such strings to UTC offsets. Or, if the log event's timezone always matches the timezone of the machine where Logstash runs you can just skip the timezone specifier.

Apart from that it should be straight forward. These date patterns will be able to parse the date when the timezone is gone:

  • M/d/YY HH:mm:ss:SSS
  • M/dd/YY HH:mm:ss:SSS
  • MM/d/YY HH:mm:ss:SSS
  • MM/dd/YY HH:mm:ss:SSS


Log event timezone and logstash server are in same timzone.

Does it mean I need to add above timestamp pattern in date filter and I don't need to use translate filter?
Or I have to use translate filter to skip timzone specifier?


Does it mean I need to add above timestamp pattern in date filter and I don't need to use translate filter?

Those patterns assume that the timestamp being parsed doesn't include a timezone.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.