# Integrate formated date to elasticsearch

**URL:** <https://discuss.elastic.co/t/integrate-formated-date-to-elasticsearch/87862>\
**Category:** Elasticsearch\
**Created:** [June 1, 2017, 8:37am UTC](https://discuss.elastic.co/t/integrate-formated-date-to-elasticsearch/87862 "2017-06-01T08:37:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylfaen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylfaen/32/17653_2.png) [@Sylfaen](https://discuss.elastic.co/u/Sylfaen)\
**Post date:** [June 1, 2017, 8:37am UTC](https://discuss.elastic.co/t/integrate-formated-date-to-elasticsearch/87862/1 "2017-06-01T08:37:23Z")

</div>

Hey

I'm trying to integrate date format like "Fri Jan 02 17:34:45 CET 2017" but logstash send me error message with malformated date at "CET 2017"

I used the response from [here](https://discuss.elastic.co/t/custom-date-format-in-elasticsearch-mapping/20240) but

> "exDate": {  
> "type": "date",  
> "format": "E MMM d H:m:s z Y"  
> },

isn't working. Is there a specific thing with CET ? How can I map my date ?

Thanks!

---

<div class="post-metadata">

**Author:** ![Sylfaen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylfaen/32/17653_2.png) [@Sylfaen](https://discuss.elastic.co/u/Sylfaen)\
**Post date:** [June 2, 2017, 8:41am UTC](https://discuss.elastic.co/t/integrate-formated-date-to-elasticsearch/87862/2 "2017-06-02T08:41:46Z")

</div>

Resolved by removing CET from the field and matching date with timezone :

```
if ([expDt]) {
    mutate {
      gsub => ["[expDt]", "CET", ""]
    }
    date {
      match => ["[expDt]", "E MMM d H:m:s Y"]
      timezone => "CET"
      target => "[expDt]"
    }
  }
```

---

<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:** [June 30, 2017, 8:41am UTC](https://discuss.elastic.co/t/integrate-formated-date-to-elasticsearch/87862/3 "2017-06-30T08:41:56Z")

</div>

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