Skip to content

Commit

Permalink
Add delimiter_pattern document to ltsv_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
okkez committed Mar 6, 2018
1 parent 1471900 commit ac10435
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion docs/v1.0/parser_ltsv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ See [Parse section configurations](parse-section)

The delimiter character (or string) of TSV values

### delimiter_pattern

| type | default | version |
|:------:|:--------:|:-------:|
| string | nil | 1.1.0 |

The delimiter pattern of TSV values.
This paramter overwrites `delimiter` paramter if specified.

### label_delimiter

| type | default | version |
Expand All @@ -22,7 +31,7 @@ The delimiter character (or string) of TSV values

The delimiter character between field name and value

## Example
## Example for LTSV

:::text
time:2013/02/28 12:00:00\thost:192.168.0.1\treq_id:111\tuser:-
Expand All @@ -41,3 +50,31 @@ This incoming event is parsed as:
}

If you set `null_value_pattern '-'` in the configuration, `user` field becomes `nil` instead of `"-"`.

## Example with delimiter_pattern

Incoming event:

:::text
timestamp=1362020400 host=192.168.0.1 req_id=111 user=-

Configuration to parse above incoming event:

:::text
<parse>
@type ltsv
delimiter_pattern /\s+/
label_delimiter =
</parse>

The incoming event is parsed as:

:::text
record:
{
"timestamp": "1362020400",
"host" : "192.168.0.1",
"req_id" : "111",
"user" : "-"
}

0 comments on commit ac10435

Please sign in to comment.