logstash-plugins / logstash-input-gelf

Apache License 2.0
20 stars 39 forks source link

Convert dots in field names to nested objects #24

Open jazzzz opened 8 years ago

jazzzz commented 8 years ago

Because Elasticsearch 2 do not support dots in field names anymore, my Gelf logs with dots are not saved. This input plugin could convert fields with dots to objects.

Like

{
  "err.stack": "stack...",
  "err.file": "file",
  "err.line": 13
}

to

{
  "err": {
    "stack": "stack...",
    "file": "file",
    "line": 13
  }
}
ph commented 8 years ago

You might want to use https://github.com/logstash-plugins/logstash-filter-de_dot as a fallback until this plugin is fixed.

jazzzz commented 7 years ago

logstash-filter-de_dot works great for objects, but I have not found a way to convert arrays.

{
  "err.0": "err 1",
  "err.1": "err 2"
}

to

{
  "err": ["err 1", "err 2"]
}