influxdb的常用操作

以非默认端口登陆inflxudb,并且能用正常的时间展示数据

influx -host localhost -port xxx -precision rfc3339

展示数据的最开始的10条:

select "ziduan" from table limit 10;

查看最近10s的数据(时间可以自定义范围)

select "ziduan" from table where tag='tag' and time > now() - 10s;

时间可以自定义范围
还可以按某个条件进行group by

select "ziduan" from table where tag='tag' and time > now() - 10s group by tag1

展示所有的tag

show tag keys from table;

select "ziduan" from table where tag='tag' and time > now() - 0.2h;
问题: ERR: error parsing query: found h, expected ; at line 1, char 76
原因: 不能用0.2h的形式

官方网站

你可能感兴趣的:(influxdb的常用操作)