关于influxdb:InfluxDB-influxQL的模糊查询

45次阅读

共计 541 个字符,预计需要花费 2 分钟才能阅读完成。

influxQL 查问 measurement 中的指标时,可应用含糊查问。

查问 measurement 中字段蕴含特定字符串:

select * from cpu_used_percent where endpoint=~/192.168.0.1/ and time > '2021-09-11T00:00:00Z' order by time desc limit 10;

查问 measurement 中字段以某个字符串起始:

select * from cpu_used_percent where endpoint=~/^datacenter/ and time > '2021-09-11T00:00:00Z' order by time desc limit 10;

查问 meaurement 中字段以某个字符串完结:

select * from cpu_used_percent where endpoint=~/vm-$/ and time > '2021-09-11T00:00:00Z' order by time desc limit 10;
// 查问以 Datacenter 结尾、vm-40 完结的时序数据
select * from cpu_used_percent where endpoint=~/^Datacenter.*vm-40$/ order by time desc limit 10;

正文完
 0