Skip to content

Commit

Permalink
Fix multiline docs (#3035)
Browse files Browse the repository at this point in the history
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
  • Loading branch information
unguiculus authored Dec 4, 2020
1 parent d70332c commit 1bb4301
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dist
coverage.txt
.DS_Store
.aws-sam
.idea

# emacs
.#*
.#*
12 changes: 6 additions & 6 deletions docs/sources/clients/promtail/stages/multiline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <string>

# 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: <duration>

# 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: <integer>
```
Expand Down Expand Up @@ -64,4 +64,4 @@ multiline:
firstline: "^\[\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2}\]"

max_wait_time: 3s
```
```
2 changes: 1 addition & 1 deletion pkg/logentry/stages/multiline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/logentry/stages/multiline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 1bb4301

Please sign in to comment.