Skip to content

Commit

Permalink
🔧 Add NS and pod by default in loki output
Browse files Browse the repository at this point in the history
Signed-off-by: afreyermuth98 <[email protected]>
  • Loading branch information
afreyermuth98 committed Jan 6, 2025
1 parent d49dfc7 commit 0b7dc26
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions outputs/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ func newLokiPayload(falcopayload types.FalcoPayload, config *types.Configuration
s["source"] = falcopayload.Source
s["priority"] = falcopayload.Priority.String()

if k8sNs, ok := falcopayload.OutputFields["k8s.ns.name"].(string); ok {
s["k8s_ns_name"] = k8sNs
}
if k8sPod, ok := falcopayload.OutputFields["k8s.pod.name"].(string); ok {
s["k8s_pod_name"] = k8sPod
}

for i, j := range falcopayload.OutputFields {
switch v := j.(type) {
case string:
Expand Down

0 comments on commit 0b7dc26

Please sign in to comment.