Influxdb 在一段时间内的值总和之后,如何获得XDB中的前5个结果
下面给出了在XDB中的测量值,我想在Grafana中显示一个表,其中前2个结果由给定传感器最常见的设备组成。 因此,以下数据的预期结果将是一个包含2束 device total ------ ---- 345678 7 234567 3 我曾经尝试过这样使用子查询,但没有得到预期的结果。它显示空响应 选择topincoming_devices_count,从选择sumdevice中选择5作为incoming_devices_count从incoming_events中选择5按设备,其中sensor='nice'和time>now-30m按设备分组 找到了查询 选择toptotal,3,从设备中选择sumvalue作为传入设备的事件总数,其中sensor='nice'和time>now按设备分组-30m > select * from incoming_events_by_device limit 50; name: incoming_events_by_device time device host metric_type sensor value ---- ------ ---- ----------- ------ ----- 1535575550000000000 123456 foo.com counter efg 1 1535575550000000000 123456 foo.com counter efg 1 1535575550000000000 234567 foo.com counter efg 1 1535575550000000000 234567 foo.com counter hij 2 1535575550000000000 234567 foo.com counter efg 1 1535575550000000000 345678 foo.com counter nice 1 1535575550000000000 358168 foo.com counter nice 1 1535575550000000000 345678 foo.com counter nice 1 1535575550000000000 345678 foo.com counter nice 4 1535575550000000000 345678 foo.com counter efg 1 1535575550000000000 345678 foo.com counter efg 12Influxdb 在一段时间内的值总和之后,如何获得XDB中的前5个结果,influxdb,Influxdb,下面给出了在XDB中的测量值,我想在Grafana中显示一个表,其中前2个结果由给定传感器最常见的设备组成。 因此,以下数据的预期结果将是一个包含2束 device total ------ ---- 345678 7 234567 3 我曾经尝试过这样使用子