List field values datatype

according to the manual page Flux InfluxDB schema package | InfluxDB Cloud Documentation you can get info about the schema of Buckets Measurements etc.

Is there a command to list all fields datatype in Chronograf ? Like
Field1 | Bool
Field2 | Integer
Field3 | String
Field4 | Real
Field5 | Real

So something like below

import "influxdata/influxdb/schema"

schema.measurementFieldDataType(
  bucket: "example-bucket",
  measurement: "example-measurement",
  start: -30d
)

Or are there other possibilities to unravel the data type

for sure there will be more ways. i am not using it, but i know there is a header comment in my exports

/usr/bin/docker container exec dck_influxdb influx query --skip-verify -c default ’ from(bucket: “hemichromis”) |> range(start: -1y, stop: now()) |> filter(fn: (r) => r["_measurement"] == “battery_adc”) ’ --raw > 2021_05_06_hemichromis_battery_adc_1y_now.csv

#group,false,false,true,true,false,false,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string
#default,_result,
,result,table,_start,_stop,_time,_value,BatSenKey,BatUlId,_field,_measurement,host
,0,2021-05-05T00:00:00Z,2021-05-06T00:00:00Z,2021-05-05T00:00:40.954Z,8.14,11,4c11aef77e7c,BatDecimal,battery_adc,spongebob
,0,2021-05-05T00:00:00Z,2021-05-06T00:00:00Z,2021-05-05T00:06:09.282Z,8.16,11,4c11aef77e7c,BatDecimal,battery_adc,spongebob
,0,2021-05-05T00:00:00Z,2021-05-06T00:00:00Z,2021-05-05T00:17:06.196Z,8.14,11,4c11aef77e7c,BatDecimal,battery_adc,spongebob

ps: you can also see that via UI in ViewRawData

1 Like

I did some testing with the raw

Integer values are listed as long, floats as double.

I searched with google, and in V1.2 there was a command SHOW FIELD KEYS like the picture below