# Mapping for 12h date format

**URL:** https://discuss.elastic.co/t/mapping-for-12h-date-format/68433
**Category:** Elasticsearch
**Created:** [December 8, 2016, 12:17pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433 "2016-12-08T12:17:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![chrisinho](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@chrisinho](https://discuss.elastic.co/u/chrisinho)
#### Post date: [December 8, 2016, 12:17pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/1 "2016-12-08T12:17:33Z")

</div>

Hi,

i have a log format with a timestamp like this :  
Dez 08, 2016 8:17:29 AM

I use a custom grok pattern for it in logstash.  
When i want elasticsearch to map it i get a mapper\_parsing\_exception.  
It says invalid format.  
How can i fix it?

My template looks like this:

> "timestamp": {  
> "index": "not\_analyzed",  
> "type": "date",  
> "format": "yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd HH:mm:ss||MMM dd, yyyy HH:mm:ss a",  
> "doc\_values": true  
> }

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [December 8, 2016, 2:26pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/2 "2016-12-08T14:26:29Z")

</div>

In the example above you have `Dez` as the month? Is this a typo or are you using a non-english locale?

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [December 8, 2016, 2:31pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/3 "2016-12-08T14:31:47Z")

</div>

If you are using a non-english locale you may need to add the `locale`option to the date field mapping to indicate the locale of the dates in your documents.

---

<div class="post-metadata">

### Author: ![chrisinho](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@chrisinho](https://discuss.elastic.co/u/chrisinho)
#### Post date: [December 8, 2016, 2:56pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/4 "2016-12-08T14:56:14Z")

</div>

Thanks! With the locale Option it works

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [December 8, 2016, 3:07pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/5 "2016-12-08T15:07:19Z")

</div>

I'm curious what locale you are using?

---

<div class="post-metadata">

### Author: ![chrisinho](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@chrisinho](https://discuss.elastic.co/u/chrisinho)
#### Post date: [December 8, 2016, 3:25pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/6 "2016-12-08T15:25:57Z")

</div>

For the given example log it is a german locale

Dez for Dezember

---

<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: [January 5, 2017, 3:26pm UTC](https://discuss.elastic.co/t/mapping-for-12h-date-format/68433/7 "2017-01-05T15:26:18Z")

</div>

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