Chage field type from string to float

Hi all

I’m new to influxDB
I want to change the field type of measurement from string to float.
Please tell me how


You have to achieve this in the gathering tool, not in InfluxDB itself

Can I change already saved string data to float data?

As far as I can determine this is not possible.
Once a measurement statistic is defined (by the first time it is added) it stays that type.
I had a runqueue as an integer but needed to change to a float = impossible.
So I changed the name coming from my data gathering tool to run_queue and added it as a float.
I guess you could extract data from InfluxDB change it - in your case removing the double quotes and then add it back under a new name.
Eventually you might prune out old data and remove in your case the strings.
Hope this helps, Nigel

Thank you for teaching me !

You can use Flux to convert values however:

Can I use Flux in influxDB v1.8 ?
Please tell me how to run the program

Here you go

Thanks @Anaisdg

I’m now trying using Flux to change the field type,
but I get the following error.

Please give me the advice

$ influx -type=flux -path-prefix /api/v2/query
Connected to http://localhost:8086/api/v2/query version 1.8.3
InfluxDB shell version: 1.8.3

from(bucket:“database”) |> range(start: -15000h) |> filter(fn: ® => r._measurement == “measurement” ) |> toFloat()
Error: unknown server error: 500 Internal Server Error