# Flatten nested fields in a json object

**URL:** https://discuss.elastic.co/t/flatten-nested-fields-in-a-json-object/46238
**Category:** Logstash
**Created:** [April 4, 2016, 12:37pm UTC](https://discuss.elastic.co/t/flatten-nested-fields-in-a-json-object/46238 "2016-04-04T12:37:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)
#### Post date: [April 4, 2016, 12:37pm UTC](https://discuss.elastic.co/t/flatten-nested-fields-in-a-json-object/46238/1 "2016-04-04T12:37:59Z")

</div>

Hi,

we are having this issue with Kibana not displaying fields from nested objects correctly.  
I've opened a topic in the Kibana discuss board, but eventually got to the understanding that this is a known and pending issue, as you can see in the mentioned thread:

> [@Show nested values in json array\\object](https://discuss.elastic.co/t/show-nested-values-in-json-array-object/44687):
>
> Hi, we have some documents that have nested objects, like the example attached. and for some reason, it doesn't show their values in kibana search tables. it used to work in Kibana3 with ES 1.x, but since we upgraded to latest versions of ELK, it doesn't work. any ideas? thanks,

so until this is resolved if at all, i'm looking for a way to work around it using logstash.  
I am sending json documents to ES with several levels of fields\objects.  
so I guess that I need to flatten those in logstash, so that a field that looks like this for example:

```
"body": {
  "message": {
	"message": {
	  "mimeType": "text/plain"
	}
  }
}

```

will become the following string:

`body.message.message.mimeType`

any ideas?

thanks,

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 5:04am UTC](https://discuss.elastic.co/t/flatten-nested-fields-in-a-json-object/46238/2 "2017-07-06T05:04:03Z")

</div>


