Skip to content

Commit

Permalink
Change log level in eventlogmessage (#2336)
Browse files Browse the repository at this point in the history
* change log level in eventlogmessage

* changelog

* update doc

* Update docs/sources/reference/components/loki/loki.process.md

Co-authored-by: Clayton Cornell <[email protected]>

---------

Co-authored-by: Clayton Cornell <[email protected]>
  • Loading branch information
wildum and clayton-cornell authored Jan 3, 2025
1 parent dbfa7b7 commit 44f2b26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Main (unreleased)

- Fixed an issue where the `otelcol.processor.interval` could not be used because the debug metrics were not set to default. (@wildum)

- Change the log level in the `eventlogmessage` stage of the `loki.process` component from `warn` to `debug`. (@wildum)

### Other changes

- Change the stability of the `livedebugging` feature from "experimental" to "generally available". (@wildum)
Expand Down
4 changes: 4 additions & 0 deletions docs/sources/reference/components/loki/loki.process.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ If set to `false`, the `_extracted` suffix will be appended to an already existi
When `drop_invalid_labels` is set to `true`, the stage drops fields that are not valid label names.
If set to `false`, the stage will automatically convert them into valid labels replacing invalid characters with underscores.

The `eventlogmessage` stage only extracts lines with the key:value format.
All non-alpha characters in the key are replaced with underscores.
For example, `\tSecurity ID` is extracted as `_Security_ID`.

#### Example combined with `stage.json`

```alloy
Expand Down
2 changes: 1 addition & 1 deletion internal/component/loki/process/stages/eventlogmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (m *eventLogMessageStage) processEntry(extracted map[string]interface{}, ke
for _, line := range lines {
parts := strings.SplitN(line, ":", 2)
if len(parts) < 2 {
level.Warn(m.logger).Log("msg", "invalid line parsed from message", "line", line)
level.Debug(m.logger).Log("msg", "invalid line parsed from message", "line", line)
continue
}
mkey := parts[0]
Expand Down

0 comments on commit 44f2b26

Please sign in to comment.