From 3326a605758d37d5c0582ec60e71c51163b575e9 Mon Sep 17 00:00:00 2001 From: Thomas Labarussias Date: Mon, 27 Jan 2025 15:36:01 +0100 Subject: [PATCH 1/2] change the printer for the logs Signed-off-by: Thomas Labarussias --- internal/pkg/utils/utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/pkg/utils/utils.go b/internal/pkg/utils/utils.go index 8cdd83f3b..28767478b 100644 --- a/internal/pkg/utils/utils.go +++ b/internal/pkg/utils/utils.go @@ -2,7 +2,7 @@ package utils -import "fmt" +import "log" const ( InfoLvl string = "info" @@ -30,8 +30,8 @@ func Log(level, output, msg string) { prefix = WarningPrefix } if output != "" { - fmt.Printf("%v : %v - %v", prefix, output, msg) + log.Printf("%v : %v - %v", prefix, output, msg) } else { - fmt.Printf("%v : %v", prefix, msg) + log.Printf("%v : %v", prefix, msg) } } From 190d7245d7883122d83c8d7703515e03992f0fa6 Mon Sep 17 00:00:00 2001 From: Thomas Labarussias Date: Mon, 27 Jan 2025 15:53:42 +0100 Subject: [PATCH 2/2] fix Falcosidekick name for consistency Signed-off-by: Thomas Labarussias --- docs/outputs/otlp_metrics.md | 5 ++++- main.go | 2 +- outputs/cliq.go | 2 +- outputs/cliq_test.go | 2 +- outputs/teams.go | 2 +- outputs/teams_test.go | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/outputs/otlp_metrics.md b/docs/outputs/otlp_metrics.md index 723ac00ce..8f6d8f0c3 100644 --- a/docs/outputs/otlp_metrics.md +++ b/docs/outputs/otlp_metrics.md @@ -11,6 +11,9 @@ - [Example of config.yaml](#example-of-configyaml) - [Additional info](#additional-info) - [Running a whole stack with docker-compose](#running-a-whole-stack-with-docker-compose) + - [Requirements](#requirements) + - [Configuration files](#configuration-files) + - [Run it](#run-it) ## Configuration @@ -88,7 +91,7 @@ services: "/usr/bin/falco" , "-o", "json_output=true", "-o", "http_output.enabled=true", - "-o", "http_output.url=http://sidekick:2801", # Set the HTTP output url to Falco sidekick endpoint + "-o", "http_output.url=http://sidekick:2801", # Set the HTTP output url to Falcosidekick endpoint "-o", "http_output.insecure=true" ] diff --git a/main.go b/main.go index c8b0fd979..9a1e60609 100644 --- a/main.go +++ b/main.go @@ -853,7 +853,7 @@ func init() { } } - utils.Log(utils.InfoLvl, "", fmt.Sprintf("Falco Sidekick version: %s", GetVersionInfo().GitVersion)) + utils.Log(utils.InfoLvl, "", fmt.Sprintf("Falcosidekick version: %s", GetVersionInfo().GitVersion)) utils.Log(utils.InfoLvl, "", fmt.Sprintf("Enabled Outputs: %s", outputs.EnabledOutputs)) } diff --git a/outputs/cliq.go b/outputs/cliq.go index 5aea500af..b733883de 100644 --- a/outputs/cliq.go +++ b/outputs/cliq.go @@ -19,7 +19,7 @@ import ( const ( tableSlideType = "table" textSlideType = "text" - botName = "Falco Sidekick" + botName = "Falcosidekick" ) // Table slide fields diff --git a/outputs/cliq_test.go b/outputs/cliq_test.go index 1c6fb6f03..78d2e9361 100644 --- a/outputs/cliq_test.go +++ b/outputs/cliq_test.go @@ -16,7 +16,7 @@ func TestNewCliqPayload(t *testing.T) { expectedOutput := cliqPayload{ Text: "\U000026AA Rule: Test rule Priority: Debug", Bot: cliqBot{ - Name: "Falco Sidekick", + Name: "Falcosidekick", Image: DefaultIconURL, }, Slides: []cliqSlide{ diff --git a/outputs/teams.go b/outputs/teams.go index 74f5f0e10..804c8739c 100644 --- a/outputs/teams.go +++ b/outputs/teams.go @@ -41,7 +41,7 @@ func newTeamsPayload(falcopayload types.FalcoPayload, config *types.Configuratio fact teamsFact ) - section.ActivityTitle = "Falco Sidekick" + section.ActivityTitle = "Falcosidekick" section.ActivitySubTitle = falcopayload.Time.String() if config.Teams.OutputFormat == All || config.Teams.OutputFormat == Text || config.Teams.OutputFormat == "" { diff --git a/outputs/teams_test.go b/outputs/teams_test.go index ce7740981..4d69ff655 100644 --- a/outputs/teams_test.go +++ b/outputs/teams_test.go @@ -18,7 +18,7 @@ func TestNewTeamsPayload(t *testing.T) { ThemeColor: "ccfff2", Sections: []teamsSection{ { - ActivityTitle: "Falco Sidekick", + ActivityTitle: "Falcosidekick", ActivitySubTitle: "2001-01-01 01:10:00 +0000 UTC", ActivityImage: "", Text: "This is a test from falcosidekick",