Skip to content

Commit 51b682e

Browse files
committed
formatter: tsv: Add TSV formatter plugin documentation
Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
1 parent eb6c662 commit 51b682e

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

plugins/formatter/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ how to develop a custom formatter.
6767
- [`msgpack`](/plugins/formatter/msgpack.md)
6868
- [`hash`](/plugins/formatter/hash.md)
6969
- [`single_value`](/plugins/formatter/single_value.md)
70+
- [`tsv`](/plugins/formatter/tsv.md)
7071

7172

7273
## List of Output/Filter Plugins with Formatter Support

plugins/formatter/tsv.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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

Comments
 (0)