logstash-input-mongodb
logstash-input-mongodb copied to clipboard
Feature request: Add support for mapping embedded mongoDB docs to Elastic 'Object' datatype
ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/object.html It would be cool if the flatten and dig parse methods can format the event names using the bracket format v.s. underscores. logstash uses this format to translate to elastic's Object datatype. If done correctly, embedded mongodb docs can be mapped to elastic objects.
E.g.
change: new_hash[k1.to_s+"_"+k2.to_s] = v2
to: new_hash["[#{k1.to_s}][#{k2.to_s}]"] = v2
thus => Mongo doc: { some_field: "some value", foo: { bar: "yay"} }
mongo logstash: "some_field" = "some value" "[foo][bar]" = "yay"
elastic: { "some_field": "some value", "foo": { bar: "yay"} }
and of course, the property needs to be mapped as an object type before applying the import: { "some_mapping": { "properties": { "some_field": {"type": "text"}, "foo": {"type": "object"} } } }