# Parsing a date and timestamp to default Elasticsearch

**URL:** <https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667>\
**Category:** Logstash\
**Created:** [December 13, 2021, 1:58pm UTC](https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667 "2021-12-13T13:58:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangesh\_shinde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mangesh_shinde/32/93271_2.png) [@mangesh\_shinde](https://discuss.elastic.co/u/mangesh_shinde)\
**Post date:** [December 13, 2021, 1:58pm UTC](https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667/1 "2021-12-13T13:58:30Z")

</div>

I have a field called event\_timestamp with format Thu Dec 09 15:02:66 IST 2021  
I want to parse this format to default elastic acceptable format  
I use date filter as below

```auto
date{
match => ["event_timestamp","EEE MMM dd HH:mm:ss zzz yyyy"]
}

```

what else I have to do still I am getting could not get index to Elasticsearch due to date field ca not parse error is there

---

<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:** [December 13, 2021, 2:30pm UTC](https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667/2 "2021-12-13T14:30:36Z")

</div>

hi Mangesh,  
this should do it

date { match =\> ["event\_timestamp", "EEE MMM dd HH:mm:ss 'IST' yyyy"]  
target =\> "event\_timestamp" }

your output will be "2021-04-18T09:17:24.000Z" -\> which is 5 hour difference. which is UTC time.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 13, 2021, 2:43pm UTC](https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667/3 "2021-12-13T14:43:44Z")

</div>

The date filter does not parse named zone, you should change your match to the one shared in the previous answer.

```auto
date { match => ["event_timestamp", "EEE MMM dd HH:mm:ss 'IST' yyyy"] }

```

Also, you will need to specify your timezone to the filter and you can't use named timezone as well because they can be ambigous, in your case, _IST_ can mean 3 completely different timezones, as explained in this [another question](https://discuss.elastic.co/t/logstash-mapping-logfile-time-to-timestamp/278772/4)

You will need something like this:

```auto
date { 
    match => ["event_timestamp", "EEE MMM dd HH:mm:ss 'IST' yyyy"] 
    timezone => "Asia/Kolkata"
}

```

Assuming that by _IST_, you mean `India Standard Time`, so you should use _Asia/Kolkata_ as the timezone.

---

<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 10, 2022, 2:44pm UTC](https://discuss.elastic.co/t/parsing-a-date-and-timestamp-to-default-elasticsearch/291667/4 "2022-01-10T14:44:13Z")

</div>

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