Kubernetes save JSON logs to file with escaped quotes. Why? Kubernetes save JSON logs to file with escaped quotes. Why? kubernetes kubernetes

Kubernetes save JSON logs to file with escaped quotes. Why?


I ran into the same issue, however I'm using fluent-bit, the "C" version of fluentd (Ruby). Since this is an older issue, I'm answering for the benefit of others who find this.

In fluent-bit v0.13, they addressed this issue. You can now specify the parser to use through annotations. The parser can be configured to decode the log as json.

The final parser with decoder looks like this:

[PARSER]    Name        embedded-json    Format      json    Time_Key    time    Time_Format %Y-%m-%dT%H:%M:%S.%L    Time_Keep   On    # Command      |  Decoder         | Field | Optional Action    # =============|==================|=======|=========    Decode_Field_As   escaped           log     do_next    Decode_Field_As   json              log