Add logtag field to crio logs#876
Add logtag field to crio logs#876chlunde wants to merge 1 commit intofluent:masterfrom chlunde:crio-logtag
Conversation
Since 1.9.0 in november 2017 cri-o has written a log tag field before the log message: https://github.com/kubernetes-sigs/cri-o/blob/f58419d6cf462070a0c3727ad2dc554ef151e832/conmon/conmon.c#L499-L509 If a single character is detected, consider this the log tag for the line. This is a part of the multiline handling for cri-o logs. Signed-off-by: Carl Henrik Lunde <chlunde@ifi.uio.no>
|
@StevenACoffman I see you mention this in your original PR. Do you remember why you did not move the tag to a dedicated field? |
|
In #667 I modeled it after the kubernetes/kubernetes#54777 fluentd change that was done in October 2017. It appears that the original example logs looked like this: Since that time, they have been revised (note the I am looking at this file: fluentd-es-configmap.yaml If you look at the regex they use here Line 128 it is currently: Where I notice that yours is: |
|
The current crio parser uses this regex: @chlunde You have proposed in #876 this regex proposal: @kskewes has this proposed this regex in #873 : If you look at the regex fluentd uses here Line 128 it is currently: Can you speak to which would best meet your understanding, use case, and experience? |
|
The CRI reached a conclusion in 1.9 to continue using the text format, with a new TAG field to address the existing issues, and provide some level of extensibility. Per kubernetes/kubernetes#44976 (comment)
New code location is https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/cri/runtime/v1alpha2/constants.go#L39-L55 |
|
I am not sure whether log messages can also look like this: I have asked for clarification in the old dead issue referenced above. |
|
@chlunde How about: Or
|
|
Thanks for taking this upstream @StevenACoffman! Changing I think we should keep Also, I realize we have an issue with greedy regex and malicious users injecting data which could confuse the parsing, so we should use So maybe I assume the log tag can never contain spaces. |
See fluent#876 and fluent#873 Signed-off-by: Steve Coffman <steve.coffman@ithaka.org>
|
See #873 (comment) I made a new PR #881 that unified this discussion and the feedback from @kskewes
|
Since 1.9.0 in november 2017 cri-o has written a log tag field before the
log message:
https://github.com/kubernetes-sigs/cri-o/blob/f58419d6cf462070a0c3727ad2dc554ef151e832/conmon/conmon.c#L499-L509
If a single character is detected, consider this the log tag for the line.
This is a part of the multiline handling for cri-o logs.
Signed-off-by: Carl Henrik Lunde chlunde@ifi.uio.no