Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InfluxQL : Influx DB conversion of a field from String to integer

Tags:

influxdb

I am new to InfluxDB. I have filled the influx measurements with time series data

I have the following measurement point

time,host,interface,value
2/11/2019 12:03:08 AM,XYZ_test ,gigabitethernet8/43,"292724"

the value is in the form of String I need to use InfluxQL to convert the column to Integer or float , how to do it ?

like image 206
user_D_A__ Avatar asked Feb 13 '19 14:02

user_D_A__


1 Answers

Using this you should be able to cast the values from float to integer.

SELECT column_name::integer FROM table_name

You can refer to the InfluxDB docs here,

https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#cast-float-field-values-to-integers

Edit: But, however, there is no support for converting a string to an integer.

like image 54
n00b Avatar answered Oct 16 '22 00:10

n00b