my task is to filter our logs against different ip subnets in form 1.1.1.0/16. (only an example).
Is there any possible way to do this via grafana and loki?
I am new to loki, so i have to learn much new things.
The only thing i have already done is to filter against one single ip.
topk(100, sum by (sourceip,destport,protoname) (count_over_time({job=~“syslog”, host=“OPNsense.localhost”,action=“block”,interface=“igb0”,direction=“in”} | sourceip = ip(“192.168.1.0/24”) or sourceip = ip(“192.168.4.0/24”) or sourceip = ip(“192.168.30.0/24”) or sourceip = ip(“193.222.200.0/23”) [1d])))
Perhabs anyone have a better solution?
From the “Logql Matching IP” website:
A CIDR specification. Examples: ip("192.51.100.0/24") , ip("2001:db8::/32")