Sometimes you would need to export a sample of the data from an InfluxDB table to a CSV file (for example to allow a data scientist to do some offline analysis using a tool like Jupyter, Zeppelin or Spark Notebook). It is possible to perform this operation through the influx command line client. This is the general syntax:
sudo /usr/bin/influx -database '<database_name>' -host '<hostname>' -username '<username>' -password '<password>' -execute 'select_statement' -format '<format>' > <file_path>/<file_name>.csv
where the format could be csv, json or column.
Example:
sudo /usr/bin/influx -database 'telegraf' -host 'localhost' -username 'admin' -password '123456789' -execute 'select * from mem' -format 'csv' > /home/googlielmo/influxdb-export/mem-export.csv
sudo /usr/bin/influx -database '<database_name>' -host '<hostname>' -username '<username>' -password '<password>' -execute 'select_statement' -format '<format>' > <file_path>/<file_name>.csv
where the format could be csv, json or column.
Example:
sudo /usr/bin/influx -database 'telegraf' -host 'localhost' -username 'admin' -password '123456789' -execute 'select * from mem' -format 'csv' > /home/googlielmo/influxdb-export/mem-export.csv
You have worked superbly with your site
ReplyDeletedata science course
I really like your writing style, great date, thank you for posting.
ReplyDeletedata science course in delhi
Thank you for sharing this post really appreciate the efforts put into this if you want you can also check out
ReplyDeletedata science course in bangalore
data science course
thanks for share
ReplyDeleteai training in aurangabad
Great blog! This is really helpful for my reference. Do share more such posts and keep us updated. Looking forward to more informative blogs from you.
ReplyDeleteWhy DevOps
DevOps Agile
Best Blog Ever i read related to this topic Students Database
ReplyDelete