# Logstash date filter can not convert certain range of unix time

**URL:** https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425
**Category:** Logstash
**Created:** [July 16, 2020, 9:28am UTC](https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425 "2020-07-16T09:28:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rex\_lin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rex_lin/32/50716_2.png) [@Rex\_lin](https://discuss.elastic.co/u/Rex_lin)
#### Post date: [July 16, 2020, 9:28am UTC](https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425/1 "2020-07-16T09:28:48Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e6d429d721dc20121ea5c2a174d099ca873c4a13.png)  
I have met some date filter problem, when tried to convert my unix time to seconds.  
As my picture, when I input "2903299199" , I except the result is "2061-12-31T23:59:59+00:00 in ISO 8601, however it returned failure.  
After trying several times, I guess logstash might have some bug to convert unix time.

Could someone fix the bug ?

---

<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: [July 16, 2020, 6:01pm UTC](https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425/2 "2020-07-16T18:01:41Z")

</div>

I think that is an [open issue](https://github.com/logstash-plugins/logstash-filter-date/issues/123) -- anything after 2038 fails.

---

<div class="post-metadata">

### Author: ![Rex\_lin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rex_lin/32/50716_2.png) [@Rex\_lin](https://discuss.elastic.co/u/Rex_lin)
#### Post date: [July 17, 2020, 6:09am UTC](https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425/3 "2020-07-17T06:09:46Z")

</div>

Thank you for your information ,  
Here is my logstash config  
\> if([expires\_at]){  
\> ruby {  
\> code =\> "event.set('expires\_at', event.get('expires\_at').to\_i \* 1000) "  
\> }  
\> }  
\> date{  
\> match =\> ["expires\_at","UNIX\_MS"]  
\> target =\> "expire\_at"  
\> }  
Finally I resolve this by convert the unix time from seconds to micro sseconds

---

<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: [August 14, 2020, 6:09am UTC](https://discuss.elastic.co/t/logstash-date-filter-can-not-convert-certain-range-of-unix-time/241425/4 "2020-08-14T06:09:54Z")

</div>

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