Etwa eine halbe Stunde um aus einem GREP ein #Grafana #Dashboard zu bauen, dass das gleiche kann...

Das Log ist aus einer #pfSense

GREP:
zstdcat syslog-pfsense.log-2026* | grep :995 | awk '{ print $8; }' | awk -F ':' '{ print $1; }' | sort | uniq -c | sort -rn

#LogQL für #Loki:
sum by(from) (count_over_time({job="syslog", instance="pfsense"} |= `:995` | regexp `from (?P<from>[0-9.]+).+` [24h]))

Just dropped a quick guide on how to build better Kyverno alerts using Loki. 🔍

The main challenge was that Kyverno logs originate from its namespace, but I needed the alert to reflect the target namespace (where the policy violation actually occurred).

I used LogQL's label_format to rewrite namespace_extracted → namespace before aggregation to get actionable alerts.

Check it out here: https://wael.nasreddine.com/kubernetes/alert-kyverno-policy-validatio.html

#Kubernetes #SRE #Loki #Kyverno #Observability #DevOps #LogQL #socialmedia

🚨Alerting on Kyverno Policy Validation Failures with Loki - Wael's Digital Garden

Working with #logs in #Loki or #VictoriaLogs
#LogQL is not the same as #LogsQL — both are optimized for querying, but with key differences.
Here’s how to convert LogQL queries to LogsQL

https://docs.victoriametrics.com/victorialogs/logql-to-logsql/

#DevOps #Observability #LogManagement #logs

VictoriaLogs: How to convert Loki queries to VictoriaLogs queries

Documentation for VictoriaMetrics, VictoriaLogs, Operator, Managed VictoriaMetrics and vmanomaly

Mal wieder 30 Minten Lebenszeit verschenkt, weil #ChatGPT nicht hilfreich war...

Daher die Frage an euch: Kann ich mit #LogQL eine Query bauen, die zwei einzelne LogQL Queries joint?

Ich will konkret aus einem #Apache #Log alle IPs sehen, die eine URL1 aufruft, eine URL2 aber NICHT aufruft.

Der Gedanke ist herauszufinden, wie hoch der Anteil der Nutzer ist, die einen AdBlocker verwenden.

Edit: LogQL kann keine Joins. Also isses wohl schlicht unmöglich: https://github.com/grafana/loki/issues/3567

Support joins on LogQL · Issue #3567 · grafana/loki

What would you like to be added: Currently LogQL has robust features in being able to do counting and various aggregations on metric fields in the log lines. On PromQL, currently we have the abilit...

GitHub
If #LogQL is so great, why can't it do a logarithm?

Seriously, why? I need that right now :(
#loki