# Numbers below zero indexed as text

**URL:** <https://discuss.elastic.co/t/numbers-below-zero-indexed-as-text/134035>\
**Category:** Logstash\
**Created:** [May 31, 2018, 11:33am UTC](https://discuss.elastic.co/t/numbers-below-zero-indexed-as-text/134035 "2018-05-31T11:33:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Boer](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Peter\_Boer](https://discuss.elastic.co/u/Peter_Boer)\
**Post date:** [May 31, 2018, 11:33am UTC](https://discuss.elastic.co/t/numbers-below-zero-indexed-as-text/134035/1 "2018-05-31T11:33:45Z")

</div>

When indexing data with numbers below zero the fields get classified as text instead of numbers. Now I cannot make value based graphs in Timelion.

This json object is indexed correctly:  
{"sensorId": 1, "values": {"gyro\_z": " 0.002", "acc\_x": " 0.172", "acc\_z": " 9.807", "gyro\_y": " 0.000", "gyro\_x": " 0.000", "acc\_y": " 0.115"}, "sensorName": "Phone sensor", "timestamp": "2018-05-31 13:05:36.650602"}

However, when starting an idex with sub zero numbers they all become strings. Like this:  
{"sensorId": 1, "values": {"gyro\_z": "-1.396", "acc\_x": " 0.211", "acc\_z": " 9.922", "gyro\_y": "-2.955", "gyro\_x": " 0.507", "acc\_y": " 0.000"}, "sensorName": "Phone sensor", "timestamp": "2018-05-31 13:06:02.303910"}

my config file:  
input  
{  
udp {  
id =\> "My\_UDP\_ID"  
port =\> 8085  
}  
}

filter  
{  
json {  
source =\> "message"  
}  
mutate{  
remove\_field =\> ["message"]  
}

}

output  
{  
elasticsearch {  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
index =\> "newstream"  
document\_type =\> "android\_data"   
}  
stdout {  
codec =\> rubydebug  
}  
}

---

<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:** [June 13, 2018, 8:29pm UTC](https://discuss.elastic.co/t/numbers-below-zero-indexed-as-text/134035/2 "2018-06-13T20:29:54Z")

</div>

Well, technically they _are_ strings as far as the JSON goes. I suggest you convert those fields to numbers with mutate filter.

---

<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:** [July 11, 2018, 8:29pm UTC](https://discuss.elastic.co/t/numbers-below-zero-indexed-as-text/134035/3 "2018-07-11T20:29:59Z")

</div>

Closed on July 11, 2018, 8:29pm UTC

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