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

remove brackets in labels + add Number as DataType #419

Merged
merged 1 commit into from
Mar 20, 2023
Merged
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
12 changes: 9 additions & 3 deletions outputs/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,17 @@ func (c *Client) PublishTopic(falcopayload types.FalcoPayload) {
}
}
for i, j := range falcopayload.OutputFields {
switch v := j.(type) {
m := strings.ReplaceAll(strings.ReplaceAll(i, "]", ""), "[", ".")
switch j.(type) {
case string:
msg.MessageAttributes[i] = &sns.MessageAttributeValue{
msg.MessageAttributes[m] = &sns.MessageAttributeValue{
DataType: aws.String("String"),
StringValue: aws.String(strings.ReplaceAll(strings.ReplaceAll(v, "]", ""), "[", ".")),
StringValue: aws.String(fmt.Sprintf("%v", j)),
}
case json.Number:
msg.MessageAttributes[m] = &sns.MessageAttributeValue{
DataType: aws.String("Number"),
StringValue: aws.String(fmt.Sprintf("%v", j)),
}
default:
continue
Expand Down