# @timestamp - Epoch - Illegal Date Format exception

**URL:** https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261
**Category:** Logstash
**Created:** [May 2, 2018, 2:19pm UTC](https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261 "2018-05-02T14:19:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SKumarMN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarmn/32/27537_2.png) [@SKumarMN](https://discuss.elastic.co/u/SKumarMN)
#### Post date: [May 2, 2018, 2:19pm UTC](https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261/1 "2018-05-02T14:19:05Z")

</div>

Hi All,

ES index is having a field with the mapping as below.

"@timestamp": {  
"format": "epoch\_millis",  
"type": "date"  
}

From logstash i want to populate this field with custom timestamp obtained from input document. The custom time stamp is in millis and i have used the filter

date{  
match =\> ["time\_mills","UNIX\_MS"]  
target =\>"@timestamp"  
}

however during indexing it fails complaining the time format issue. Can you please help

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [May 2, 2018, 4:37pm UTC](https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261/2 "2018-05-02T16:37:05Z")

</div>

The date filter always produces an ISO8601 timestamp that can't be stored in your `@timestamp` field.

If you already have the time in milliseconds in the `time_millis` field, why would you need a date filter? Just copy the field value to the `@timestamp` field.

---

<div class="post-metadata">

### Author: ![SKumarMN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarmn/32/27537_2.png) [@SKumarMN](https://discuss.elastic.co/u/SKumarMN)
#### Post date: [May 3, 2018, 12:00pm UTC](https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261/3 "2018-05-03T12:00:33Z")

</div>

I had tried the below but got the same issues hence went with date filter

filter {  
mutate {  
copy =\> { "time\_millis" =\> "@timestamp" }  
}  
}

---

<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: [May 31, 2018, 12:00pm UTC](https://discuss.elastic.co/t/timestamp-epoch-illegal-date-format-exception/130261/4 "2018-05-31T12:00:36Z")

</div>

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