# Logstash slowlog field took\_in\_millis shows microseconds instead of milliseconds

**URL:** <https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146>\
**Category:** Logstash\
**Created:** [December 28, 2016, 2:20pm UTC](https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146 "2016-12-28T14:20:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick4eva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick4eva/32/15969_2.png) [@nick4eva](https://discuss.elastic.co/u/nick4eva)\
**Post date:** [December 28, 2016, 2:20pm UTC](https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146/1 "2016-12-28T14:20:42Z")

</div>

I configured Logstash slowlog like this:

slowlog.threshold.warn: 500ms  
[slowlog.threshold.info](http://slowlog.threshold.info): 400ms  
slowlog.threshold.debug: 300ms  
slowlog.threshold.trace: 100ms

But I see in slowlog file trace entry with "took\_in\_millis":103180  
I don't believe that my event processing 103 seconds, so I looked at source code and found that took\_in\_millis calculated incorrectly, it should be took\_in\_nanos / 1000000 instead of took\_in\_nanos / 1000

> <https://github.com/elastic/logstash/blob/master/logstash-core/lib/logstash/logging/logger.rb#L109>

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 29, 2016, 10:28pm UTC](https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146/2 "2016-12-29T22:28:01Z")

</div>

Can you raise that as an issue on Github?

---

<div class="post-metadata">

**Author:** ![nick4eva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick4eva/32/15969_2.png) [@nick4eva](https://discuss.elastic.co/u/nick4eva)\
**Post date:** [January 3, 2017, 9:44pm UTC](https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146/3 "2017-01-03T21:44:53Z")

</div>

Raised an issue [https://github.com/elastic/logstash/issues/6476](https://github.com/elastic/logstash/issues/6476)

---

<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 31, 2017, 9:44pm UTC](https://discuss.elastic.co/t/logstash-slowlog-field-took-in-millis-shows-microseconds-instead-of-milliseconds/70146/4 "2017-01-31T21:44:54Z")

</div>

Closed on January 31, 2017, 9:44pm UTC

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