Srinivas V.
Srinivas V.

Reputation: 321

Syntax error in Influx query to extract data from influx to csv

I'm trying to extract data from my influx DB to a csv file using the below commands from terminal. It is showing me some syntax error.

influx \ -host "$INFLUXDB_HOST" \ -username "$INFLUXDB_USERNAME" \ -password "$INFLUXDB_PASSWORD" \ -ssl \ -precision rfc3339 \ -format "csv" \ -execute "select * from "users" where "_user_id" = '2830278'" \ -database "$INFLUXDB_DATABASE" > "usersdata".csv;

the error I'm getting is: error parsing query: found USERS, expected identifier at line 1, char 15

There is something I'm missing here. can someone look at this and tell me.

Upvotes: 0

Views: 278

Answers (1)

Srinivas V.
Srinivas V.

Reputation: 321

This did work

influx \
     -host "$INFLUXDB_HOST" \
     -username "$INFLUXDB_USERNAME" \
     -password "$INFLUXDB_PASSWORD" \
     -ssl \
     -precision rfc3339 \
     -format "csv" \
     -execute "select * from users where _user_id = '2830278'" \
     -database "$INFLUXDB_DATABASE" > "usersdata".csv;

Upvotes: 0

Related Questions