Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new parser: logfmt #871

Merged
merged 1 commit into from
Nov 2, 2018
Merged

Conversation

manuelluis
Copy link
Contributor

No description provided.

Signed-off-by: Manuel Luis Sanmartín Rozada <[email protected]>
@manuelluis
Copy link
Contributor Author

The logfmt format is described in https://brandur.org/logfmt
a more formal description is in https://godoc.org/github.com/kr/logfmt

$ cat test.txt                      
key1=val1 key2=val2
key1=val1 key2 = val2
key1=val1 key2=val2 key3 key4= key5 key6=value6
key1=val1 key2=val2 key3="v \"a\" l u e"
key1=val1 key2=val2 key3="foo foo aaa lke = 65
key%^as$=val1 %asd.5$^ a b c d e
$ cat parser.conf                      
[PARSER]
    Name        logfmt
    Format      logfmt
$ ./fluent-bit -R parser.conf -i tail -p path=test.txt -p parser=logfmt -o stdout
Fluent-Bit v0.15.0
Copyright (C) Treasure Data

[2018/10/30 22:58:13] [ info] [engine] started (pid=30913)
[0] tail.0: [1540936693.000000000, {"key1"=>"val1", "key2"=>"val2"}]
[1] tail.0: [1540936693.000000000, {"key1"=>"val1", "key2"=>true, "val2"=>true}]
[2] tail.0: [1540936693.000000000, {"key1"=>"val1", "key2"=>"val2", "key3"=>true, "key4"=>true, "key5"=>true, "key6"=>"value6"}]
[3] tail.0: [1540936693.000000000, {"key1"=>"val1", "key2"=>"val2", "key3"=>"v \"a\" l u e"}]
[4] tail.0: [1540936693.000000000, {"key1"=>"val1", "key2"=>"val2", "key3"=>"foo foo aaa lke = 65"}]
[5] tail.0: [1540936693.000000000, {"key%^as$"=>"val1", "%asd.5$^"=>true, "a"=>true, "b"=>true, "c"=>true, "d"=>true, "e"=>true}]

Solves #562

@edsiper edsiper merged commit 920a189 into fluent:master Nov 2, 2018
@edsiper
Copy link
Member

edsiper commented Nov 2, 2018

thanks @manuelluis !

shogo82148 added a commit to shogo82148/fluent-bit-docs that referenced this pull request Jun 18, 2019
ltsv and logfmt parsers are already supported, but there are no document.

- Add new parser: ltsv fluent/fluent-bit#646
- Add new parser: logfmt fluent/fluent-bit#871

I added the document about them.
shogo82148 added a commit to shogo82148/fluent-bit-docs that referenced this pull request Jun 18, 2019
ltsv and logfmt parsers are already supported, but there are no document.

- Add new parser: ltsv fluent/fluent-bit#646
- Add new parser: logfmt fluent/fluent-bit#871

I added the document about them.

Signed-off-by: Ichinose Shogo <[email protected]>
edsiper pushed a commit to fluent/fluent-bit-docs that referenced this pull request Jun 21, 2019
ltsv and logfmt parsers are already supported, but there are no document.

- Add new parser: ltsv fluent/fluent-bit#646
- Add new parser: logfmt fluent/fluent-bit#871

I added the document about them.

Signed-off-by: Ichinose Shogo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants