diff --git a/.gitignore b/.gitignore index 66550b4959717..d1994bf0ae09a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ dist coverage.txt .DS_Store .aws-sam +.idea # emacs -.#* \ No newline at end of file +.#* diff --git a/docs/sources/clients/promtail/stages/multiline.md b/docs/sources/clients/promtail/stages/multiline.md index 267468c82205d..1f6289cc007c5 100644 --- a/docs/sources/clients/promtail/stages/multiline.md +++ b/docs/sources/clients/promtail/stages/multiline.md @@ -13,17 +13,17 @@ A new block is identified by the `firstline` regular expression. Any line that d ```yaml multiline: # RE2 regular expression, if matched will start a new multiline block. - # This expresion must be provided. + # This expression must be provided. firstline: # The maximum wait time will be parsed as a Go duration: https://golang.org/pkg/time/#ParseDuration. - # If now new logs arrive withing this maximum wait time the current block will be sent on. - # This is useful if the opserved application dies with e.g. an exception. No new logs will arrive and the exception - # block is sent *after* the maximum wait time expired. + # If no new logs arrive within this maximum wait time the current block will be sent on. + # This is useful if the observed application dies with e.g. an exception. No new logs will arrive and the exception + # block is sent *after* the maximum wait time expires. # It defaults to 3s. max_wait_time: - # Maximum number of lines a block can have. If block has more lines a new block is started. + # Maximum number of lines a block can have. If the block has more lines a new block is started. # The default is 128 lines. max_lines: ``` @@ -64,4 +64,4 @@ multiline: firstline: "^\[\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2}\]" max_wait_time: 3s -``` \ No newline at end of file +``` diff --git a/pkg/logentry/stages/multiline.go b/pkg/logentry/stages/multiline.go index 731d3ae31c9e3..05be74566de01 100644 --- a/pkg/logentry/stages/multiline.go +++ b/pkg/logentry/stages/multiline.go @@ -66,7 +66,7 @@ func validateMultilineConfig(cfg *MultilineConfig) error { return nil } -// dropMultiline matches lines to determine whether the following lines belong to a block and should be collapsed +// multilineStage matches lines to determine whether the following lines belong to a block and should be collapsed type multilineStage struct { logger log.Logger cfg *MultilineConfig diff --git a/pkg/logentry/stages/multiline_test.go b/pkg/logentry/stages/multiline_test.go index 9b58bca094afa..52f8724741557 100644 --- a/pkg/logentry/stages/multiline_test.go +++ b/pkg/logentry/stages/multiline_test.go @@ -16,7 +16,6 @@ import ( ) func Test_multilineStage_Process(t *testing.T) { - // Enable debug logging cfg := &ww.Config{} require.Nil(t, cfg.LogLevel.Set("debug")) @@ -47,6 +46,7 @@ func Test_multilineStage_Process(t *testing.T) { require.Equal(t, "START line 2", out[3].Line) require.Equal(t, "START line 3", out[4].Line) } + func Test_multilineStage_MultiStreams(t *testing.T) { // Enable debug logging cfg := &ww.Config{}