Hello, I'm using logstash to load MongoDB data to elasticsearch. I get MongoDB data inside the map field (inside source). I want data to be part of the source, not in a separate field.
I used db.collection.find() statement and I'm getting documents as,
{
"_index": "test",
"_type": "doc",
"_id": "wxma3GkBX1wUOA268XBA",
"_score": 1,
"_source": {
"map": {
"_id": "5b534ae2e4b0671367e2e3ce",
"total": 247,
"status": active,
"dateModified": 1553585121902,
},
"@timestamp": "2019-04-02T05:52:14.923Z",
"@version": "1"
}
}
I want it as :
{
"_index": "test",
"_type": "doc",
"_id": "wxma3GkBX1wUOA268XBA",
"_score": 1,
"_source": {
"_id": "5b534ae2e4b0671367e2e3ce",
"total": 247,
"status": active,
"dateModified": 1553585121902,
"@timestamp": "2019-04-02T05:52:14.923Z",
"@version": "1"
}
}