# Template Date filter

**URL:** <https://discuss.elastic.co/t/template-date-filter/122506>\
**Category:** Elasticsearch\
**Created:** [March 5, 2018, 12:17pm UTC](https://discuss.elastic.co/t/template-date-filter/122506 "2018-03-05T12:17:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgdesrochers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgdesrochers/32/51322_2.png) [@tgdesrochers](https://discuss.elastic.co/u/tgdesrochers)\
**Post date:** [March 5, 2018, 12:17pm UTC](https://discuss.elastic.co/t/template-date-filter/122506/1 "2018-03-05T12:17:55Z")

</div>

Elastic 6.2

Warning:

```auto
[2018-03-05T12:14:44,717][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"index-2018.02.13", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x65ce2a9c>], :response=>{"index"=>{"_index"=>"index-2018.02.13", "_type"=>"doc", "_id"=>"MtQV9mEBFrxQ1xe84c5m", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [EventTime]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"2018-02-13 22:23:54.776966Z\" is malformed at \".776966Z\""}}}}}

```

Template:

```auto
          "EventTime": {
            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss.SSSSSSZ",
            "ignore_malformed": true,
            "type": "date"
          },

```

I would have thought this would parse the date/time in this field correctly. Is there a glaring reason this would be gailing that part of the template?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 5, 2018, 3:41pm UTC](https://discuss.elastic.co/t/template-date-filter/122506/2 "2018-03-05T15:41:40Z")

</div>

I wonder if this is because for now elasticsearch does not support nansecond precision? See

> <https://github.com/elastic/elasticsearch/issues/10005>

And

> <https://github.com/elastic/elasticsearch/issues/27330>

---

<div class="post-metadata">

**Author:** ![tgdesrochers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgdesrochers/32/51322_2.png) [@tgdesrochers](https://discuss.elastic.co/u/tgdesrochers)\
**Post date:** [March 5, 2018, 5:09pm UTC](https://discuss.elastic.co/t/template-date-filter/122506/3 "2018-03-05T17:09:19Z")

</div>

I don't think so. I have it working on another index with the same template. The non working one is from sysmon records and the working one is from raw event logs. but the fields `EventTime` and `EventReceivedTime` are printed by my shipper (NXlog) not by eventlog or sysmon.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 2, 2018, 5:09pm UTC](https://discuss.elastic.co/t/template-date-filter/122506/4 "2018-04-02T17:09:29Z")

</div>

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