# Logstash auto-transforming data, rendering it useless

**URL:** <https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496>\
**Category:** Logstash\
**Created:** [March 13, 2020, 11:41am UTC](https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496 "2020-03-13T11:41:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattness](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattness/32/52975_2.png) [@Mattness](https://discuss.elastic.co/u/Mattness)\
**Post date:** [March 13, 2020, 11:41am UTC](https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496/1 "2020-03-13T11:41:31Z")

</div>

Hey there,

I am using logstash to write data from my mssql database to elasticsearch.  
For whatever reason logstash transfrom the db-field "Duration" which contains values in the style of: "00:00:45.4388525" into this: "2020-03-13T00:00:02.609Z".

I have tried all kinds of input-plugins, filter-plugins, changed the sql statement, transformed the db-field so it would not contain the ":", created a custom index-template.

The closest I got was using this filter:

filter {  
mutate {  
convert =\> { "duration" =\> "float" }  
}  
}

and changing the statement so the field would not contain ":".  
In addition I mapped the field as "long" in the index-template.

This is the only way that even returned a number that could be formatted as a duration in kibana.  
All the other methods I tried returned either strings or dates.

Does anyone actually know why logstash is auto transforming this number? I just want to be able to use the field-value as a duration in ms.

regards & thanks in advance.

---

<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:** [March 13, 2020, 5:47pm UTC](https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496/2 "2020-03-13T17:47:24Z")

</div>

If a column in a database is a date/time then the jdbc input will automatically transform it into a LogStash::Timestamp. You can probably prevent that by including a CAST in your SQL.

---

<div class="post-metadata">

**Author:** ![Mattness](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattness/32/52975_2.png) [@Mattness](https://discuss.elastic.co/u/Mattness)\
**Post date:** [March 17, 2020, 10:53am UTC](https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496/3 "2020-03-17T10:53:02Z")

</div>

Indeed that seems to be the problem. Thanks a lot.

---

<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:** [April 14, 2020, 10:53am UTC](https://discuss.elastic.co/t/logstash-auto-transforming-data-rendering-it-useless/223496/4 "2020-04-14T10:53:14Z")

</div>

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