# Parse nested json

**URL:** <https://discuss.elastic.co/t/parse-nested-json/46114>\
**Category:** Logstash\
**Created:** [April 2, 2016, 3:59am UTC](https://discuss.elastic.co/t/parse-nested-json/46114 "2016-04-02T03:59:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ajays](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@ajays](https://discuss.elastic.co/u/ajays)\
**Post date:** [April 4, 2016, 12:25pm UTC](https://discuss.elastic.co/t/parse-nested-json/46114/8 "2016-04-04T12:25:47Z")

</div>

@magnusbaeck, I found this earlier post of yours ([Help parsing nested JSON with dynamic top key](https://discuss.elastic.co/t/help-parsing-nested-json-with-dynamic-top-key/41069)) and tried to use this but somehow it is not working. This is the updated configuration

input {  
stdin {}  
}

filter {  
ruby {  
code =\> "  
event.to\_hash.clone.each\_value{|v|  
if v.is\_a? Hash  
v.each\_pair{|k,v|  
print event[k] = v  
}  
end  
}  
"  
}  
}  
output {  
stdout { codec =\> rubydebug }  
}

---

_[View the full topic](https://discuss.elastic.co/t/parse-nested-json/46114)._
