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

Gerade mal ein bisschen mit ner #LogQL Query rumgespielt und entdeckt, dass der json extractor extrem effizient ist.

Wenn ich nur die paar Felder aus dem json raushole, die ich auch verarbeite, statt einfach "alles" wird braucht die Query plötzlich nur noch 80ms, statt wie davor 500ms.

Da die Query alle 5 Sekunden läuft, dürfte das letztich doch einiges an CPU-Zyklen einsparen :))

#Loki

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