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

Update default encoding #146

Closed
Closed
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
2 changes: 1 addition & 1 deletion docs/operators/file_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `file_input` operator reads logs from files. It will place the lines read in
| `poll_interval` | 200ms | The duration between filesystem polls |
| `multiline` | | A `multiline` configuration block. See below for details |
| `write_to` | $ | The body [field](/docs/types/field.md) written to when creating a new log entry |
| `encoding` | `nop` | The encoding of the file being read. See the list of supported encodings below for available options |
| `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` |
| `include_file_path` | `false` | Whether to add the file path as the label `file_path` |
| `start_at` | `end` | At startup, where to start reading logs from the file. Options are `beginning` or `end` |
Expand Down
4 changes: 2 additions & 2 deletions operator/builtin/input/file/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewInputConfig(operatorID string) *InputConfig {
StartAt: "end",
MaxLogSize: defaultMaxLogSize,
MaxConcurrentFiles: defaultMaxConcurrentFiles,
Encoding: "nop",
Encoding: "utf-8",
}
}

Expand Down Expand Up @@ -179,7 +179,7 @@ var encodingOverrides = map[string]encoding.Encoding{
"ascii": unicode.UTF8,
"us-ascii": unicode.UTF8,
"nop": encoding.Nop,
"": encoding.Nop,
"": unicode.UTF8,
}

func lookupEncoding(enc string) (encoding.Encoding, error) {
Expand Down