Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将我的 InfluxDB 数据库导出到 CSV 文件。我目前使用以下代码:
$ influx -database 'Dabtabase_name' -execute 'SELECT * FROM table_name' -format csv > test.csv
该代码有效,但时间戳显示为数字,如下所示:
1609459200000000000
我想以时间戳以 RFC3339 格式保存的方式保存它,如下所示:
2021-01-01T00:00:00
首次连接到 CLI 时,指定 rfc3339 精度
$ influx -precision rfc3339
要在导出到 CSV 时获取 RFC 3339,请使用此选项。
$ influx -precision 'rfc3339' -database 'Dabtabase_name' -execute 'SELECT * FROM table_name' -format csv > test.csv