Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiline docs #3035

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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