1

I am running a query in a batch process to extract data from InfluxDB. Query output always contains the measurement name as part of each line of output. Is there a way to remove the measurement name from the query result?

This is the command I am using to generate the output file.

influx -database my_db -format csv -precision rfc3339 
-execute "select column1, column2 from measurement1 limit 1" > 2.csv


name, time, column1, column2

measurement1, 2019-05-22T08:30:33Z, data1, data2

Expected output

time, column1, column2

2019-05-22T08:30:33Z, data1, data2
darkDragon
  • 455
  • 3
  • 12

1 Answers1

1

InfluxDB does not provide a way to do this. However, with the help of cut on a *nix CLI:

cut -d, -f1 --complement influxdb.csv

This will remove the first column from your CSV file

Rawkode
  • 21,990
  • 5
  • 38
  • 45
  • Is there a plan to bring that feature with influxSQL? How can I request this feature? Is influxSQL code base is freely available to make this change on a fork ? – darkDragon May 31 '19 at 13:48