Skip to content

Commit

Permalink
fluent-bit: Redact basic auth credentials from fluent-bit logging (#1…
Browse files Browse the repository at this point in the history
…1308)

This redacts the basic auth credentials from the configured URL that is
displayed when fluent-bit is started, if these are included. Go's
built-in redaction only hides the password, turning a url like
`http://user:[email protected]` into `http://user:[email protected]`.

Fixes #10514
  • Loading branch information
rgroothuijsen authored Dec 1, 2023
1 parent fe4d9be commit cf84b2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clients/cmd/fluent-bit/out_grafana_loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func FLBPluginInit(ctx unsafe.Pointer) int {

level.Info(logger).Log("[flb-go]", "Starting fluent-bit-go-loki", "version", version.Info())
paramLogger := log.With(logger, "[flb-go]", "provided parameter")
level.Info(paramLogger).Log("URL", conf.clientConfig.URL)
level.Info(paramLogger).Log("URL", conf.clientConfig.URL.Redacted())
level.Info(paramLogger).Log("TenantID", conf.clientConfig.TenantID)
level.Info(paramLogger).Log("BatchWait", fmt.Sprintf("%.3fs", conf.clientConfig.BatchWait.Seconds()))
level.Info(paramLogger).Log("BatchSize", conf.clientConfig.BatchSize)
Expand Down

0 comments on commit cf84b2e

Please sign in to comment.