添加带有多个值的标签在发泄/infuxdB中

发布于 2025-01-29 05:23:42 字数 206 浏览 4 评论 0原文

是否可以使用InfluxDB线协议在InfluxDB中的单个标签中发送多个值?

类似这样的

application-metric, application=test-app,API=get,put cpu=15 1465839830100400200

测量和时间戳是相同的,但同一键的标签不同。 InfluxDB:1.8

Is it possible to send multiple values in a single tag in influxdb using the influxdb line protocol?

Something like this

application-metric, application=test-app,API=get,put cpu=15 1465839830100400200

Essentially measurement and timestamp are the same but different tags of the same key.
InfluxDB: 1.8

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

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

发布评论

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

评论(1

孤独岁月 2025-02-05 05:23:42

我不完全了解您想要的东西,所以我只是回答盲目折叠:

涌入1.8作为线路协议一个测量和一个(可选)时间戳。然后,您可以根据需要添加尽可能多的标签和字段(=值)。

语法为:

measurement(,tag_set) field_set (timestamp)

where as at at As Tag_Settag_key = tag_valuefield_set is field_key = field_value每个comma-分开如果> 1
因此,它没有标签和3个字段(=值):

myMeasurement temperature1=10,temperature2=20,status="all good" 1556813561098000000

带有标签“传感器”和“位置”和3个字段:

myMeasurement,sensor=627,location=Narnia temperature1=10,temperature2=20,status="all good" 1556813561098000000

在一行中可能可以。但是您无法在一行中发送两个不同的标签值夫妻。而且,您不能用相同的field_set编写两个不同的点,但是在同一行(afaik)中,相同tag_key的不同tag_value

如果您在一个标签中需要几个不同的“值”,则可以以某种方式将其发送到以某种方式将其发送给它,以稍后将其发送到正则:

myMeasurement,location=Narnia;South-West;Valley4 temperature1=10 1556813561098000000
SELECT * FROM myMeasurement WHERE location=~ /.*;South-West;.*/

I don't exactly get what you want, so I just answering blind folded:

Influx 1.8 takes as line protocol one measurement and one (optional) timestamp. Then you can add as many tags and fields (=values) as you like.

Syntax is:

measurement(,tag_set) field_set (timestamp)

where as tag_set is tag_key=tag_value and field_set is field_key=field_value each of them comma-separated if >1
therefore it works without tags and 3 fields (=values):

myMeasurement temperature1=10,temperature2=20,status="all good" 1556813561098000000

with tags "sensor" and "location" and 3 fields:

myMeasurement,sensor=627,location=Narnia temperature1=10,temperature2=20,status="all good" 1556813561098000000

That's possible in one line. But you can not send two different tag-value-couples in one line. And you can't write two different points with same field_set but different tag_value for the same tag_key in the same line (afaik).

If you need several different "values" in one tag you could send it somehow separated by whatever and regex for it later:

myMeasurement,location=Narnia;South-West;Valley4 temperature1=10 1556813561098000000
SELECT * FROM myMeasurement WHERE location=~ /.*;South-West;.*/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文