# Unable to extract nested json from pipeline

**URL:** <https://community.graylog.org/t/unable-to-extract-nested-json-from-pipeline/15152>\
**Category:** Graylog Central (peer support)\
**Created:** [April 27, 2020, 7:19am UTC](https://community.graylog.org/t/unable-to-extract-nested-json-from-pipeline/15152 "2020-04-27T07:19:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hydra\_sp](https://avatars.discourse-cdn.com/v4/letter/h/dec6dc/32.png) [@Hydra\_sp](https://community.graylog.org/u/Hydra_sp)\
**Post date:** [April 27, 2020, 7:20am UTC](https://community.graylog.org/t/unable-to-extract-nested-json-from-pipeline/15152/1 "2020-04-27T07:20:00Z")

</div>

Hello,

I want to set fields for the below mentioned json .However I am unable to set fields for the nested json.

Json example:  
{“message”:“Hello”,“data”:{“TrnId”:“101”,“InstId”:“504”}}

I need set fields for the nested json fields TrnId and InstId along with message.

Here is the Output which i get

 ![msg](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/e/e19ae4aa5654df564547ad38d58fdff4958157f0.png)

Pipeline which i used to extract the Json.

rule “extract-json”  
when  
starts\_with(to\_string($message.message), “{”) && ends\_with(to\_string($message.message), “}”)  
then  
let json = parse\_json(to\_string($message.message));  
let map = to\_map(json);  
set\_fields(map);  
end

Kindly let me know if I have entered anything incorrectly.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [May 11, 2020, 7:20am UTC](https://community.graylog.org/t/unable-to-extract-nested-json-from-pipeline/15152/2 "2020-05-11T07:20:01Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
