Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Update force flush default #261

Merged
merged 4 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion docs/operators/file_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `file_input` operator reads logs from files. It will place the lines read in
| `exclude` | [] | A list of file glob patterns to exclude from reading |
| `poll_interval` | 200ms | The duration between filesystem polls |
| `multiline` | | A `multiline` configuration block. See below for details |
| `force_flush_period` | `0s` | Time since last read of data from file, after which currently buffered log should be send to pipeline. Takes [duration](../types/duration.md) as value. Zero means waiting for new data forever |
| `force_flush_period` | `500ms` | Time since last read of data from file, after which currently buffered log should be send to pipeline. Takes [duration](../types/duration.md) as value. Zero means waiting for new data forever |
| `write_to` | `$body` | The body [field](/docs/types/field.md) written to when creating a new log entry |
| `encoding` | `utf-8` | The encoding of the file being read. See the list of supported encodings below for available options |
| `include_file_name` | `true` | Whether to add the file name as the attribute `file.name` |
Expand Down
4 changes: 4 additions & 0 deletions operator/builtin/input/file/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ func TestMapStructureDecodeConfigWithHook(t *testing.T) {
"line_start_pattern": expect.Splitter.Multiline.LineStartPattern,
"line_end_pattern": expect.Splitter.Multiline.LineEndPattern,
},
"force_flush_period": "500ms",
"include_file_name": true,
"include_file_path": false,
"start_at": "end",
Expand Down Expand Up @@ -749,6 +750,9 @@ func TestMapStructureDecodeConfig(t *testing.T) {
"max_log_size": 1024 * 1024,
"max_concurrent_files": 1024,
"encoding": "utf16",
"force_flush_period": map[string]interface{}{
"Duration": time.Millisecond * 500,
},
djaglowski marked this conversation as resolved.
Show resolved Hide resolved
}

var actual InputConfig
Expand Down
2 changes: 1 addition & 1 deletion operator/helper/multiline.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type FlusherConfig struct {
func NewFlusherConfig() FlusherConfig {
return FlusherConfig{
// Empty or `0s` means that we will never force flush
Period: Duration{Duration: 0},
Period: Duration{Duration: time.Millisecond * 500},
}
}

Expand Down