# EPOCH Parsing | Logstash

**URL:** https://discuss.elastic.co/t/epoch-parsing-logstash/220132
**Category:** Logstash
**Created:** [February 20, 2020, 8:52am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132 "2020-02-20T08:52:28Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![deeshu](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@deeshu](https://discuss.elastic.co/u/deeshu)
#### Post date: [February 20, 2020, 8:52am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/1 "2020-02-20T08:52:28Z")

</div>

Hi techs....

Does anyone have grok pattern available to convert epoch timings to date time format. If yes, could any one do the noble cause and share here..

Have seen couple of posts as below for this where Grok UNIX\_MS is used to suffice this requirement. But unluckily when I checked in my environment, I didn't find any such Grok pattern.

> [@Load Epoch time](https://discuss.elastic.co/t/load-epoch-time/44410/7):
>
> Hi , I also tried to put the time filter after the json filter (with and without target). I can see the new loaded index with the new record under the list of indexes in the ElasticSearch (using the command curl 'localhost:9200/\_cat/indices?v') but I can't reach the data in the Kibana filter{ json { source =\> "message" } } filter{ date { match =\> ["startTime", "UNIX"] target =\> "@timestamp" } } The time is added automatically as the load time of the data into the ElasticSearch , I …

TIA,  
Deepak Shukla

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 20, 2020, 3:15pm UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/2 "2020-02-20T15:15:51Z")

</div>

UNIX\_MS is used in a date filter, not in a grok filter.

---

<div class="post-metadata">

### Author: ![deeshu](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@deeshu](https://discuss.elastic.co/u/deeshu)
#### Post date: [February 21, 2020, 9:51am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/3 "2020-02-21T09:51:00Z")

</div>

Hi @Badger and @chenbe2204.. Thanks for your inputs.

Basically below is the logs I am getting from AWS WAF and objective is to convert the epoch to date time format. To achieve this, have tried below pipeline, unfortunately it's not working. Any suggestions...any headups?

{"timestamp":1574785248813,"formatVersion":1,"webaclId":"XXXXXXXXXXXXXXXX-YYYYYYYYYYYYY","terminatingRuleId":"Default\_Action","terminatingRuleType":"REGULAR","action":"ALLOW","httpSourceName":"XX"………………………………………………………….

```
else if [APPLICATION] =~ "aem-waf"
{
  json {
    source => "message"
  }
  date 
  {
      match => ["epoch_time", "UNIX_MS"]
    target => "timestamp"
  }
  mutate { add_tag => ["json_parse"] }
}

```

TIA,  
Deepak Shukla

---

<div class="post-metadata">

### Author: ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)
#### Post date: [February 21, 2020, 11:28am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/4 "2020-02-21T11:28:44Z")

</div>

Hi

I think this is exaclty what you are looking for: [Unix\_ms time to date](https://discuss.elastic.co/t/unix-ms-time-to-date/220262)

Hope this helps.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 21, 2020, 3:27pm UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/5 "2020-02-21T15:27:48Z")

</div>

> [@deeshu](#):
>
> match =\> ["epoch\_time", "UNIX\_MS"]

Your JSON contains a field called timestamp, not epoch\_time.

---

<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: [February 21, 2020, 3:37pm UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/6 "2020-02-21T15:37:46Z")

</div>

> [@deeshu](#):
>
> 1574785248813

as Badger said you need something like this

```
date { match => ["timestamp", "UNIX_MS","ISO8601"]
             target => "timestamp"
        }

```

---

<div class="post-metadata">

### Author: ![deeshu](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@deeshu](https://discuss.elastic.co/u/deeshu)
#### Post date: [February 26, 2020, 3:05am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/7 "2020-02-26T03:05:30Z")

</div>

@elasticforme @Badger @ITIC..... Thanks guys. Awesome. It worked well. Thank you so much for all your contribution. Feeling lil relieved 🙂

---

<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: [March 25, 2020, 3:05am UTC](https://discuss.elastic.co/t/epoch-parsing-logstash/220132/8 "2020-03-25T03:05:39Z")

</div>

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