|
| 1 | +# `tsv` Formatter Plugin |
| 2 | + |
| 3 | +The `tsv` formatter plugin converts an event as TSV. |
| 4 | + |
| 5 | +```text |
| 6 | +value1[delimiter]value2[newline] |
| 7 | +``` |
| 8 | + |
| 9 | + |
| 10 | +## Parameters |
| 11 | + |
| 12 | +- [Common Parameters](/configuration/plugin-common-parameters.md) |
| 13 | +- [Format section configurations](/configuration/format-section.md) |
| 14 | + |
| 15 | +### `keys` |
| 16 | + |
| 17 | +| type | default | version | |
| 18 | +|:----------------|:---------|:--------| |
| 19 | +| array of string | `nil` | 0.14.0 | |
| 20 | + |
| 21 | +Specifies the output fields. It is a required parameter. |
| 22 | + |
| 23 | +### `delimiter` |
| 24 | + |
| 25 | +| type | default | version | |
| 26 | +|:-------|:-----------|:--------| |
| 27 | +| string | `\t` (TAB) | 0.14.0 | |
| 28 | + |
| 29 | +Delimiter for the fields. |
| 30 | + |
| 31 | +### `add_newline` |
| 32 | + |
| 33 | +| type | default | version | |
| 34 | +|:-----|:--------|:--------| |
| 35 | +| bool | `true` | 0.14.12 | |
| 36 | + |
| 37 | +Adds `\n` to the result. |
| 38 | + |
| 39 | +### `newline` |
| 40 | + |
| 41 | +| type | default | version | |
| 42 | +|:-----|:------------------------------------------------|:--------| |
| 43 | +| enum | `lf (for non-Windows)` or `crlf (for Windows)` | 1.11.5 | |
| 44 | + |
| 45 | + |
| 46 | +Specify newline characters. |
| 47 | + |
| 48 | +## Example |
| 49 | + |
| 50 | +```text |
| 51 | +tag: app.event |
| 52 | +time: 1362020400 |
| 53 | +record: {"host":"192.168.0.1","size":777,"method":"PUT"} |
| 54 | +``` |
| 55 | + |
| 56 | +This incoming event is formatted to: |
| 57 | + |
| 58 | +In non-Windows: |
| 59 | + |
| 60 | +```text |
| 61 | +192.168.0.1\t777\tPUT\n |
| 62 | +``` |
| 63 | + |
| 64 | +In non-Windows: |
| 65 | + |
| 66 | +```text |
| 67 | +192.168.0.1\t777\tPUT\r\n |
| 68 | +``` |
| 69 | + |
| 70 | +------------------------------------------------------------------------ |
| 71 | + |
| 72 | +If this article is incorrect or outdated, or omits critical information, please |
| 73 | +[let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). |
| 74 | +[Fluentd](http://www.fluentd.org/) is an open-source project under |
| 75 | +[Cloud Native Computing Foundation (CNCF)](https://cncf.io/). All components are |
| 76 | +available under the Apache 2 License. |
0 commit comments