更新与 InfluxDB 中的条件匹配的多个字段值 [英] Update multiple field values matching a condition in InfluxDB

查看:31
本文介绍了更新与 InfluxDB 中的条件匹配的多个字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 InfluxDB 测量中,如何更新匹配查询的点的字段值?这仍然 从 v1.6 起不容易实现?

In an InfluxDB measurement, how can the field values of points matching a query be updated? Is this still not easily doable as of v1.6?

正如 GitHub 票证中所建议的示例,实现此类目标的最简洁方法是什么?

As the example in that GitHub ticket suggested, what's the cleanest way of achieving something like this?

UPDATE access_log SET username='something' WHERE mac='xxx'

有什么比通过 更新单个点?

推荐答案

问: 匹配查询的点的字段值如何更新?从 v1.4 开始,这仍然不容易实现吗?

Q: How can the field values of points matching a query be updated? Is this still not easily doable as of v1.4?

答:据我所知,在 1.4 版本中还没有简单的方法来完成 update.

A: From the best of my knowledge, there isn't an easy way to accomplish update in version 1.4 yet.

字段值只能通过覆盖来更新.也就是说,要覆盖它的值,您需要知道您的点的详细信息.这些详细信息包括它的 timestampseries 信息,即它所在的度量值及其对应的 tags.

Field value of a point can only be updated by overriding. That is, to overwrite its value you'll need to know the details of your points. These details include its timestamp and series information, which is the measurement it reside and its corresponding tags.

注意:这种更新"策略只能用于改变field的值,不能改变tag的值.要更新 tag 值,您需要先 DELETE 点数据,然后用更新的标签和值重写整个点数据.

Note: This "update" strategy can only be used for changing the field value but not tag value. To update a tag value you'll need to first DELETE the point data first and rewrite the entire point data with the updated tag and value.

问:有什么比通过更新单个点从客户端驱动所有内容更好的方法?

Q: Anything better than driving it all from the client by updating individual points?

答: Influxdb 支持 多点写入.因此,如果您可以构建一个过滤器来预先选择一个小的点数据集,修改它们的 field 值,然后批量覆盖它们.

A: Influxdb supports multi-point write. So if you can build a filter to pre-select a small dataset of points, modify their field values and then override them in bulk.

这篇关于更新与 InfluxDB 中的条件匹配的多个字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆