Notification - traefik router name
Hello,
does anyone know how I can extract the value of the alerts key "traefik_router_name" and put it in the notification message?
My current settings are like this:
format: |
{{range . -}}
{{$alert := . -}}
{{range .Decisions -}}
{{.Value}} ({{$alert.Source.Cn}}) wird für die nächsten {{.Duration}} gesperrt, da der Alarm „{{.Scenario}}“ von {{$alert.MachineID}} ausgelöst wurde.
https://app.crowdsec.net/cti/{{.Value}}
{{end -}}
{{end -}}
Thanks!
6 Replies
Important Information
This post has been marked as resolved. If this is a mistake please press the red button below or type
/unresolve
© Created By WhyAydan for CrowdSec ❤️
I added the baseline here https://github.com/crowdsecurity/hub/issues/1348#issuecomment-2829861426
GitHub
How to parse Traefik router name from an alert · Issue #1348 · cr...
I am using a custom http notification channel that feeds alerts as JSON into VictoriaMetrics. The code looks like this: type: http name: http_victoriametrics log_level: info format: > {{- range ...
but in short it should be like:
Thanks that worked 🙂
Resolving Notification - traefik router name
This has now been resolved. If you think this is a mistake please run
/unresolve
Also you can
{{range $traefikRouters | uniq -}}
to get unique routers