Skip to content

Commit

Permalink
Don't produce duplicate entries when events have non-string fields (#38)
Browse files Browse the repository at this point in the history
Don't produce duplicate entries when events have non-string fields
  • Loading branch information
Issif authored Oct 4, 2019
2 parents b93c1d4 + 33145a2 commit a7f48a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions outputs/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ func newAlertmanagerPayload(falcopayload types.FalcoPayload) []alertmanagerPaylo
case string:
//AlertManger doesn't support dots in a label name
amPayload.Labels[strings.Replace(i, ".", "_", -1)] = j.(string)
default:
continue
}
}
amPayload.Labels["source"] = "falco"
Expand Down
2 changes: 1 addition & 1 deletion outputs/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/falcosecurity/falcosidekick/types"
)

var falcoTestInput = `{"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule", "time":"2001-01-01T01:10:00Z","output_fields": {"proc.name":"falcosidekick","user.name":"falcosidekick"}}`
var falcoTestInput = `{"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule", "time":"2001-01-01T01:10:00Z","output_fields": {"proc.name":"falcosidekick","user.name":"falcosidekick", "proc.tty": 1234}}`

func TestNewClient(t *testing.T) {
u, _ := url.Parse("http://localhost")
Expand Down
2 changes: 2 additions & 0 deletions outputs/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func newSlackPayload(falcopayload types.FalcoPayload, config *types.Configuratio
} else {
field.Short = false
}
default:
continue
}
fields = append(fields, field)
}
Expand Down
2 changes: 2 additions & 0 deletions outputs/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func newTeamsPayload(falcopayload types.FalcoPayload, config *types.Configuratio
case string:
fact.Name = i
fact.Value = j.(string)
default:
continue
}
facts = append(facts, fact)
}
Expand Down

0 comments on commit a7f48a7

Please sign in to comment.