# Help needed for field to template date mapping

**URL:** <https://discuss.elastic.co/t/help-needed-for-field-to-template-date-mapping/209120>\
**Category:** Logstash\
**Created:** [November 22, 2019, 9:15pm UTC](https://discuss.elastic.co/t/help-needed-for-field-to-template-date-mapping/209120 "2019-11-22T21:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SathishPrakasam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sathishprakasam/32/46290_2.png) [@SathishPrakasam](https://discuss.elastic.co/u/SathishPrakasam)\
**Post date:** [November 22, 2019, 9:15pm UTC](https://discuss.elastic.co/t/help-needed-for-field-to-template-date-mapping/209120/1 "2019-11-22T21:15:51Z")

</div>

Hi team,

My date mapping from logstash,

logstash:

date  
{  
match =\> ["logtime" , "yyyy-MM-dd HH:mm:ss"]  
timezone =\> UTC  
}

Field mapping in the template:

"logtime": {"type": "date","format":"yyyy-MM-dd HH:mm:ss"},

When the logstash maps the filed with template am getting below error,

[2019-11-22T15:06:29,634][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"lsh-usa\_verizon\_core2a\_8650sdm\_v4-2019.11.22", :\_type=\>"doc", :\_routing=\>nil}, #LogStash::Event:0x6d8370d6], :response=\>{"index"=\>{"\_index"=\>"lsh-usa\_verizon\_core2a\_8650sdm\_v4-2019.11.22", "\_type"=\>"doc", "\_id"=\>"yLXwlG4BIqQPqzL4CoVd", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to find type parsed [string] for [logtime]"}}}}

Can some one help where am i missing and how to fix this?

Regards,  
Sathish

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [November 22, 2019, 9:34pm UTC](https://discuss.elastic.co/t/help-needed-for-field-to-template-date-mapping/209120/2 "2019-11-22T21:34:06Z")

</div>

I generally have to do target in date filter.

date  
{  
match =\> ["logtime" , "yyyy-MM-dd HH:mm:ss"]  
timezone =\> UTC  
target =\> "logtime"  
}

what is your output when you do without date filter.?  
may be that field is null or something else for that record.

---

<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:** [December 21, 2019, 5:00am UTC](https://discuss.elastic.co/t/help-needed-for-field-to-template-date-mapping/209120/4 "2019-12-21T05:00:10Z")

</div>

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