Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't produce duplicate entries when events have non-string fields #38

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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