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

Do you know how much data that is?
Also have you considered using the UI? I find it useful for construction Flux queries and debugging.

There is an UI for Influx 1.8? I can’t fins info about that. Can you point me to the right direction?

I also need to change field types.

Hello @EDsteve,
Yes there’s a UI for 1.8.
It’s called Chronograf:

How are you writing data to influxDB? It would be better to change the field type before ingestion rather than after the fact.

You are right. It happened AFTER. Definitely setting it BEFORE next time. But it was not very important data. So i just made a new measurement at the end.

I use Graphana as data visualizer.
So with Chronograph i can change filed types? I didn’t know that.