InfluxDB 1.8:将测量数据导出到CSV,更改和进口数据

发布于 2025-01-21 04:13:12 字数 246 浏览 2 评论 0 原文

使用

influx -database 'myDatabase' -execute 'SELECT * from myMeasurement' -format csv > Influxdata.csv

i将所有mymeasurements值导出到CSV文件。

我更改了CSV文件中的一些值(标签名称更改)。 现在,我需要将更改的数据导入Mymesaurement。

有什么办法吗?

Using

influx -database 'myDatabase' -execute 'SELECT * from myMeasurement' -format csv > Influxdata.csv

I exported all myMeasurements values to a csv file.

I changed some values in the csv file (Tag Name change).
Now I need to import the changed data back to myMesaurement.

Is there any way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

英雄似剑 2025-01-28 04:13:12

据我所知,您将不得不手动将该CSV手动转换为“导入”喜欢的格式。

非常有用,但是它们提供的示例非常有限。在值和时间戳被空间分离之前,所有字段都需要进行逗号分隔。例如:

# DML
# CONTEXT-DATABASE: test
data_set,Build=213,Connection=CMD,Database=tpcds,Environment=tpcds62_cold_ni,Query=01,Run=1,Run_Type=POWER value=6.388357 1684159577000000000

然后用类似命令的命令导入,根据时间戳的精度进行调整以及文件的详细信息:

influx -import -path=test.csv -precision ns

As far as I can tell, you're going to have to manually convert that csv into the format import likes.

https://docs.influxdata.com/influxdb/v1.8/tools/shell/#import-data-from-a-file-with--import is quite useful, but the example they supply is quite limited. All the fields need to be comma-separated before the value and the timestamp are separated by spaces. E.g.:

# DML
# CONTEXT-DATABASE: test
data_set,Build=213,Connection=CMD,Database=tpcds,Environment=tpcds62_cold_ni,Query=01,Run=1,Run_Type=POWER value=6.388357 1684159577000000000

Then import that with a command like, adjusted for the precision of your timestamps and the details of your file:

influx -import -path=test.csv -precision ns
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文