Skip to content

Commit

Permalink
chore(bors): merge pull request #344
Browse files Browse the repository at this point in the history
344: feat(loki): adding multiline support r=abhilashshetty04 a=abhilashshetty04

With multiline support we define starting point of the log block when it gets filtered through `logcli` parameter. 

Every log that we stdout starts with timestamp(with ansi color char now by default) . In Regex1 , `\x1b\[2m` matches colour unicode pattern. logger adds 2 zero width space also hence Regex has space to match.

 We might have uncolored timestamp in future. So In Regex2, we handle that scenario.

Regex1: '^  \x1b\[2m(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{6})Z'

Regex2 : '^  (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{6})Z'

Co-authored-by: Abhilash Shetty <[email protected]>
  • Loading branch information
mayastor-bors and abhilashshetty04 committed Sep 22, 2023
2 parents 0cd3e88 + e0f027f commit 6f64600
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,15 @@ loki-stack:
- job_name: {{ .Release.Name }}-pods-name
pipeline_stages:
- docker: {}
- replace:
expression: '(\n)'
replace: ""
- multiline:
firstline: '^ \x1b\[2m(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{6})Z'
max_wait_time: 3s
- multiline:
firstline: '^ (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{6})Z'
max_wait_time: 3s
kubernetes_sd_configs:
- role: pod
relabel_configs:
Expand Down

0 comments on commit 6f64600

Please sign in to comment.