loghouse icon indicating copy to clipboard operation
loghouse copied to clipboard

hierarchical JSON in log

Open r-moiseev opened this issue 6 years ago • 2 comments

Hi,

Our log message looks like

{
  "message": "som message"
  "context": {some json}
}

Problem is, with current fluentd configuration, context goes to clickhouse as a plain text (with => symbol in place of :), and there is no way to filter logs against fields in context.

Is there way to fix it? Thanks.

r-moiseev avatar Nov 15 '18 08:11 r-moiseev

PR #115 contains a workaround for hierarchical JSON problem. It is applicable if json log contains a specific key.

I think we need a more generalized approach to this problem. For example implement mapping with like this:

original:
{
  "message": "som message"
  "context": {
    "path":"/",
    "username":"admin"
  }
  "params": ["green", "red", "blue" ]
}


resulting string_fields:

message = "som message"
context.path = "/"
context.username="admin"
params.0 = "green"
params.1 = "red"
params.2 = "blue"

diafour avatar Dec 06 '18 11:12 diafour

Any news about the issue?

kiaplayer avatar Oct 22 '20 13:10 kiaplayer