Skip to content

Commit

Permalink
Combine multiline log into single entry
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Sep 11, 2024
1 parent 050cd9e commit 40d3e42
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions charts/datalayer-observer/templates/logs-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ spec:
- type: container
id: container-parser
max_log_size: 102400
# Router to use different multiline logs logic
- type: router
routes:
- output: combine_python_otel_logs
expr: 'resource["k8s.container.name"] in ["iam", "jupyter", "operator", "operator-companion"]'
default: combine_logs
- id: combine_python_otel_logs
type: recombine
output: noop
combine_field: body
# Match asctime '<YEAR>-<MONTH>-<DAY> <HOUR>:'
is_first_entry: body matches "^\\d{4}-\\d{2}-\\d{2} \\d{2}:"
source_identifier: attributes["log.file.path"]
- id: combine_logs
type: recombine
combine_field: body
is_first_entry: body matches "^[^\\s]"
source_identifier: attributes["log.file.path"]
# Trick to skip routes
- type: noop

processors:
# https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor
Expand Down

0 comments on commit 40d3e42

Please sign in to comment.