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

查看:770
本文介绍了更新与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?

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

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

Field value只能通过覆盖来更新.也就是说,要覆盖其价值,您需要知道要点的详细信息.这些详细信息包括其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?

A: Influxdb支持

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天全站免登陆