logfmt: don't omit last item if it does not have a value#4359
logfmt: don't omit last item if it does not have a value#4359edsiper merged 1 commit intofluent:masterfrom
Conversation
622bc3c to
87c9410
Compare
|
With this line in foo.log
The unpatched version outputs: And the fixed version outputs: |
|
|
Thank you for contribution.
I think it should be Note: Original PR to support logfmt is #871. #1737 might cause regression ? |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
I had another look at this, and current logfmt gives all bare keys a nil value, it just misses the last one. So those are two independent bugs, and we should be able to merge this pr as-is. I'll file another pr for the nil vs true issue. |
In fluent#4359, @nokute78 notes that bare keys in logfmt lines get the wrong value after parsing: they should get a `true` value, not `nil`.
In fluent#4359, @nokute78 notes that bare keys in logfmt lines get the wrong value after parsing: they should get a `true` value, not `nil`. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
87c9410 to
4834054
Compare
In fluent#4359, @nokute78 notes that bare keys in logfmt lines get the wrong value after parsing: they should get a `true` value, not `nil`. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
A line like `foo=bar baz` should be parsed to `{"foo"=>"bar", "baz"=>nil}`, but `baz` was silently omitted by returning early from the parser.
Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
4834054 to
2851630
Compare
In fluent#4359, @nokute78 notes that bare keys in logfmt lines get the wrong value after parsing: they should get a `true` value, not `nil`. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Manal Geries <mgeriesa@gmail.com>
In fluent#4359, @nokute78 notes that bare keys in logfmt lines get the wrong value after parsing: they should get a `true` value, not `nil`. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: root <root@sumit-acs.novalocal>
A line like
foo=bar bazshould be parsed to{"foo"=>"bar", "baz"=>nil}, butbazwas silently omitted by returning early from the parser.Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.