diff --git a/cmd/crowdsec-cli/explain.go b/cmd/crowdsec-cli/explain.go index d73d9b7d1..0c33a845e 100644 --- a/cmd/crowdsec-cli/explain.go +++ b/cmd/crowdsec-cli/explain.go @@ -146,7 +146,7 @@ func runExplain(cmd *cobra.Command, args []string) error { return err } if lineCount > 100 { - log.Warnf("log file contains %d lines. This may take lot of resources.", lineCount) + log.Warnf("The log file contains %d lines. This may take a lot of resources.", lineCount) } } diff --git a/cmd/crowdsec-cli/main.go b/cmd/crowdsec-cli/main.go index 10da0dbfd..cd6f6a12a 100644 --- a/cmd/crowdsec-cli/main.go +++ b/cmd/crowdsec-cli/main.go @@ -53,11 +53,11 @@ func initConfig() { } if !slices.Contains(NoNeedConfig, os.Args[1]) { + log.Debugf("Using %s as configuration file", ConfigFilePath) csConfig, mergedConfig, err = csconfig.NewConfig(ConfigFilePath, false, false, true) if err != nil { log.Fatal(err) } - log.Debugf("Using %s as configuration file", ConfigFilePath) if err := csConfig.LoadCSCLI(); err != nil { log.Fatal(err) } diff --git a/go.mod b/go.mod index 8b6b6c527..4565e816c 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/c-robinson/iplib v1.0.3 github.com/cespare/xxhash/v2 v2.2.0 github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26 - github.com/crowdsecurity/go-cs-lib v0.0.3 + github.com/crowdsecurity/go-cs-lib v0.0.4 github.com/crowdsecurity/grokky v0.2.1 github.com/crowdsecurity/machineid v1.0.2 github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index 879d1ae30..c8cbb50bf 100644 --- a/go.sum +++ b/go.sum @@ -134,8 +134,8 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26 h1:r97WNVC30Uen+7WnLs4xDScS/Ex988+id2k6mDf8psU= github.com/crowdsecurity/dlog v0.0.0-20170105205344-4fb5f8204f26/go.mod h1:zpv7r+7KXwgVUZnUNjyP22zc/D7LKjyoY02weH2RBbk= -github.com/crowdsecurity/go-cs-lib v0.0.3 h1:NPSHTLS83A3wFyzV5R9Py8fBbTrVHu/1PQeaD7id4+I= -github.com/crowdsecurity/go-cs-lib v0.0.3/go.mod h1:8FMKNGsh3hMZi2SEv6P15PURhEJnZV431XjzzBSuf0k= +github.com/crowdsecurity/go-cs-lib v0.0.4 h1:mH3iqz8H8iH9YpldqCdojyKHy9z3JDhas/k6I8M0ims= +github.com/crowdsecurity/go-cs-lib v0.0.4/go.mod h1:8FMKNGsh3hMZi2SEv6P15PURhEJnZV431XjzzBSuf0k= github.com/crowdsecurity/grokky v0.2.1 h1:t4VYnDlAd0RjDM2SlILalbwfCrQxtJSMGdQOR0zwkE4= github.com/crowdsecurity/grokky v0.2.1/go.mod h1:33usDIYzGDsgX1kHAThCbseso6JuWNJXOzRQDGXHtWM= github.com/crowdsecurity/machineid v1.0.2 h1:wpkpsUghJF8Khtmn/tg6GxgdhLA1Xflerh5lirI+bdc= diff --git a/pkg/acquisition/modules/docker/docker_test.go b/pkg/acquisition/modules/docker/docker_test.go index 7d4d938d1..3c3eeefe6 100644 --- a/pkg/acquisition/modules/docker/docker_test.go +++ b/pkg/acquisition/modules/docker/docker_test.go @@ -193,7 +193,7 @@ container_name_regexp: actualLines++ ticker.Reset(1 * time.Second) case <-ticker.C: - log.Infof("no more line to read") + log.Infof("no more lines to read") dockerSource.t.Kill(nil) return nil } diff --git a/pkg/apiserver/apic_metrics.go b/pkg/apiserver/apic_metrics.go index cfaf79147..eb239fba9 100644 --- a/pkg/apiserver/apic_metrics.go +++ b/pkg/apiserver/apic_metrics.go @@ -83,7 +83,7 @@ func (a *apic) SendMetrics(stop chan (bool)) { // intervals must always be > 0 metInts := []time.Duration{1*time.Millisecond, a.metricsIntervalFirst, a.metricsInterval} - log.Infof("Start send metrics to CrowdSec Central API (interval: %s once, then %s)", + log.Infof("Start sending metrics to CrowdSec Central API (interval: %s once, then %s)", metInts[1].Round(time.Second), metInts[2]) count := -1 diff --git a/pkg/database/alerts.go b/pkg/database/alerts.go index 3a5041444..1b1a4667e 100644 --- a/pkg/database/alerts.go +++ b/pkg/database/alerts.go @@ -96,7 +96,7 @@ func formatAlertAsString(machineID string, alert *models.Alert) []string { var retStr []string if alert.Decisions[0].Origin != nil && *alert.Decisions[0].Origin == types.CscliImportOrigin { - return []string{fmt.Sprintf("(%s) alert : %s for %d decisions", machineID, reason, len(alert.Decisions))} + return []string{fmt.Sprintf("(%s) alert : %s", machineID, reason)} } for i, decisionItem := range alert.Decisions { diff --git a/pkg/database/flush.go b/pkg/database/flush.go index 44d145d0b..a7b364fa9 100644 --- a/pkg/database/flush.go +++ b/pkg/database/flush.go @@ -269,7 +269,7 @@ func (c *Client) FlushAlerts(MaxAge string, MaxItems int) error { } } if deletedByNbItem > 0 { - c.Log.Infof("flushed %d/%d alerts because max number of alerts has been reached (%d max)", deletedByNbItem, totalAlerts, MaxItems) + c.Log.Infof("flushed %d/%d alerts because the max number of alerts has been reached (%d max)", deletedByNbItem, totalAlerts, MaxItems) } if deletedByAge > 0 { c.Log.Infof("flushed %d/%d alerts because they were created %s ago or more", deletedByAge, totalAlerts, MaxAge) diff --git a/pkg/parser/stage.go b/pkg/parser/stage.go index 37d43fbfe..9f650e116 100644 --- a/pkg/parser/stage.go +++ b/pkg/parser/stage.go @@ -75,7 +75,7 @@ func LoadStages(stageFiles []Stagefile, pctx *UnixParserCtx, ectx EnricherCtx) ( //check for empty bucket if node.Name == "" && node.Description == "" && node.Author == "" { - log.Infof("Node in %s has no name,author or description. Skipping.", stageFile.Filename) + log.Infof("Node in %s has no name, author or description. Skipping.", stageFile.Filename) continue } //check compat