revision
This commit is contained in:
23
influxdb/by_nginx_verb.flux
Normal file
23
influxdb/by_nginx_verb.flux
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
v = {
|
||||
"timeRangeStart": 2023-06-16T14:44:00Z,
|
||||
"timeRangeStop": 2023-06-18T14:44:00Z
|
||||
}
|
||||
|
||||
bucket = "telegraf"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
hosts = ${httpHost:json}
|
||||
|
||||
hostsLength = hosts |> length()
|
||||
measurement = "nginx_access-logv3"
|
||||
from(bucket: "${bucket}")
|
||||
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|
||||
|> filter(fn: (r) => r["_measurement"] == measurement and r["_field"] == "nginx_host")
|
||||
|> filter(fn: (r) => if hostsLength>0 then contains(value: r["_value"], set: hosts) else true)
|
||||
|> group(columns: ["verb"])
|
||||
|> count()
|
||||
|> group()
|
||||
|> sort(columns: ["_value"], desc: true)
|
||||
|
||||
Reference in New Issue
Block a user