Our data looks like this and there are 20000 nodes
node status time node-1 status: down 1 hr before node-1 status: up now
select count(*) from node_health where status = 'down' and $timeFilter group by node
I want the above query to return 0 but it doesn't.
I think I can solve this by following query.
select count(*) from (select last(status) from node_health where $timeFilter group by node) where status = 'down'
But I wanted improve the performance by adding the status where clause . My query is real slow takes 50 seconds to load.
How to make this work without subquery so as I can improve the performance of the query.
hello there! A query question. Do you know if it is possible to sum the total sum of two independent measurements in a single query? For instance, for query
select sum(value) from metric_1_traffic_in,metric_2_traffic_in where time > now() - 1h ; the following is returned:
name: metric_1_traffic_in time sum ---- --- 1573034400000000000 308346.88 name: metric_2_traffic_in time sum ---- --- 1573034400000000000 150405.12000000002
Is there a way to have 308346.88 + 150405.12000000002 in a single result row?
Hello All ! I’d like to understand what would be the efficient query to filter a large number of tag values while performing a group by . Here’s an example
Let’s assume we have 5000 hosts which have telegraf running and all of them send their metrics to an influxdb located elsewhere . Lets take the “CPU” telegraf metric for example . Now I’d like to fetch the average CPU consumed for a list of hosts which can be say around 300 . Now “host” is a tag for each metric which is unique for each host.
What would be the most efficient way to query influx to just get the average cpu for the last 1 day for 300 specific hosts?
Lets say the tag values for host are host1,host2,host3 etc
I currently know of only 2 methods
1) Just chain the OR statements
select mean(usage_system) from cpu where time > now() - 1d where host=‘host1’ or host=‘host2’ or … (for 300 hosts) group by host
select mean(usage_system) from cpu where time > now() - 1d where host ~= /host1|host2|host3|…(300hosts)/ group by host
I find both of them highly inefficient . Is there a better way to do this?
client.WriteAPItakes org, bucket but not sure, doesn't seem necessary?
Hi, I've restarted influxdb and the port has changed from 8086 to 8086. This is my code in influxdb.conf `[http]
enabled = true
flux-enabled = true
bind-address = ":8086"
realm = "InfluxDB"
How can I use again the port 8086? I cannot use it now (it is not accepted as data source in Grafana ("Bad gateway")