# How to use fliter's json to parsing nested json

**URL:** https://discuss.elastic.co/t/how-to-use-fliters-json-to-parsing-nested-json/60072
**Category:** Logstash
**Created:** [September 8, 2016, 12:33pm UTC](https://discuss.elastic.co/t/how-to-use-fliters-json-to-parsing-nested-json/60072 "2016-09-08T12:33:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![WangXiangUSTC](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@WangXiangUSTC](https://discuss.elastic.co/u/WangXiangUSTC)
#### Post date: [September 8, 2016, 12:33pm UTC](https://discuss.elastic.co/t/how-to-use-fliters-json-to-parsing-nested-json/60072/1 "2016-09-08T12:33:19Z")

</div>

I use the fliter's json to parse nested json, the log is like below:

```
{
"time":"2016-09-08T20:25:48.657327288+08:00",
"requested_id":"34545665",
"body":"{\"data\":\"fheufrgjidjweidwjfndfefm",\"code\":\"200\"}"

```

}  
this data is saved in the field "message"

and below is my config:  
fliter {  
json {  
source =\> "message"  
}  
}

but after the fliter, the field "data" in "body" is not parsing, it also look like below:  
{  
"time":"2016-09-08T20:25:48.657327288+08:00",  
"requested\_id":"34545665",  
"body":"{"data":"fheufrgjidjweidwjfndfefm","code":"200"}"  
}

It looks like that the fliter's json can only parse the top level of json data. so ,how to parse nested json?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [September 8, 2016, 1:25pm UTC](https://discuss.elastic.co/t/how-to-use-fliters-json-to-parsing-nested-json/60072/2 "2016-09-08T13:25:18Z")

</div>

The body field papers to be a string containing a serialised JSON object, and the parsing is therefore correct as far as I can see. If you want to parse this field further you should be able to apply the json filter to this field.

---

<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, 4:39am UTC](https://discuss.elastic.co/t/how-to-use-fliters-json-to-parsing-nested-json/60072/3 "2017-07-06T04:39:14Z")

</div>


