# Failure to convert epoch number in scientific format to date

**URL:** https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871
**Category:** Logstash
**Tags:** docker
**Created:** [December 14, 2019, 12:36pm UTC](https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871 "2019-12-14T12:36:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jlevym](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlevym/32/59383_2.png) [@jlevym](https://discuss.elastic.co/u/jlevym)
#### Post date: [December 14, 2019, 12:36pm UTC](https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871/1 "2019-12-14T12:36:32Z")

</div>

my input json file (coming from mongoexport) is showing the time in scientific notation, for example:

> "lastUpdate":1.575882773525e+12

When I try and convert this to date format using "UNIX\_MX" I get the following

> lastUpdate 1,575,882,773,525

and the system @timestamp is incorrect:

> @timestamp Dec 9, 2019 @ 11:12:53.525 (the correct timestamp is Dec 14 2019 and works fine when I don't us the date filter)

Please suggest how I can fix this issue.

This is my input and filter code:

> ```
> input {
> file {
> path => "/usr/share/logstash/mydata/mongodb.json"  
> start_position => "beginning"
> sincedb_path => "/dev/null"
> codec => json
> }
> }
> 
> ## Add your filters / logstash plugins configuration here
> 
> filter {
> 
> date {
> match => ["lastUpdate" => "UNIX_MS"]
> }
> 
> mutate { remove_field => ["_id", "path", "host", "userId", "lessonId", "tags", "classreportId", "data.lesson.image", "answers.checkAnswer"] }
> }
> 
> ```

---

<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: [December 14, 2019, 5:10pm UTC](https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871/2 "2019-12-14T17:10:56Z")

</div>

I don't understand the issue. A date filter is used to modify @timestamp by default. If you want it to modify another field then use the target option. And specify the timezone too, since 1,575,882,773,525 is 2019/12/09 9:12:53.525 (9 AM, not 11 AM).

---

<div class="post-metadata">

### Author: ![jlevym](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlevym/32/59383_2.png) [@jlevym](https://discuss.elastic.co/u/jlevym)
#### Post date: [December 15, 2019, 5:10pm UTC](https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871/3 "2019-12-15T17:10:04Z")

</div>

Thank you so much for pointing this out to me. I had a basic misunderstanding of how this plugin works and this cleared it up and now it runs perfectly!

---

<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 12, 2020, 5:14pm UTC](https://discuss.elastic.co/t/failure-to-convert-epoch-number-in-scientific-format-to-date/211871/4 "2020-01-12T17:14:20Z")

</div>

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