Skip to content

Commit

Permalink
made syslog protocol lower case
Browse files Browse the repository at this point in the history
Signed-off-by: bluca <bruno.luca@mercadolibre.com>
  • Loading branch information
bdluca authored and poiana committed Sep 2, 2021
1 parent c054ae3 commit 44db5aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions outputs/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"github.com/falcosecurity/falcosidekick/types"
"log"
"log/syslog"
"strings"
)

func NewSyslogClient(config *types.Configuration, stats *types.Statistics, promStats *types.PromStatistics, statsdClient, dogstatsdClient *statsd.Client) (*Client, error) {
ok := validateProtocol(config.Syslog.Protocol)
ok := isValidProtocolString(strings.ToLower(config.Syslog.Protocol))
if !ok {
return nil, fmt.Errorf("failed to configure Syslog client: invalid protocol %s", config.Syslog.Protocol)
}
Expand All @@ -25,7 +26,7 @@ func NewSyslogClient(config *types.Configuration, stats *types.Statistics, promS
}, nil
}

func validateProtocol(protocol string) bool {
func isValidProtocolString(protocol string) bool {
return protocol == TCP || protocol == UDP
}

Expand Down

0 comments on commit 44db5aa

Please sign in to comment.