Skip to content

Commit 20039d3

Browse files
committed
Adding YAML examples to LTSV parser doc. Part of issue #1865.
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent 5c7b82a commit 20039d3

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

pipeline/parsers/ltsv.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,24 @@ LogFormat "host:%h\tident:%l\tuser:%u\ttime:%t\treq:%r\tstatus:%>s\tsize:%b\tref
1313
CustomLog "logs/access_log" combined_ltsv
1414
```
1515

16-
The parser.conf:
16+
The following is an example parsers configuration file:
17+
18+
{% tabs %}
19+
{% tab title="parsers.yaml" %}
20+
21+
```yaml
22+
parsers:
23+
- name: access_log_ltsv
24+
format: ltsv
25+
time_key: time
26+
time_format: '[%d/%b/%Y:%H:%M:%S %z]'
27+
types: status:integer size:integer
28+
```
29+
30+
{% endtab %}
31+
{% tab title="parsers.conf" %}
1732
18-
```python
33+
```text
1934
[PARSER]
2035
Name access_log_ltsv
2136
Format ltsv
@@ -24,6 +39,9 @@ The parser.conf:
2439
Types status:integer size:integer
2540
```
2641

42+
{% endtab %}
43+
{% endtabs %}
44+
2745
The following log entry is a valid content for the parser defined above:
2846

2947
```text
@@ -42,5 +60,4 @@ After processing, it internal representation will be:
4260
[1531222025.000000000, {"host"=>"127.0.0.1", "ident"=>"-", "user"=>"-", "req"=>"GET /assets/css/style.css HTTP/1.1", "status"=>200, "size"=>1279, "referer"=>"http://127.0.0.1/", "ua"=>"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0"}]
4361
```
4462

45-
The time has been converted to Unix timestamp \(UTC\).
46-
63+
The time has been converted to Unix timestamp \(UTC\).

0 commit comments

Comments
 (0)