Reputation: 465
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
Upvotes: 1
Views: 240
Reputation: 22592
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
Upvotes: 1