# KibanaSavedObjectMeta.searchSorceJSON format

**URL:** <https://discuss.elastic.co/t/kibanasavedobjectmeta-searchsorcejson-format/227847>\
**Category:** Kibana\
**Created:** [April 14, 2020, 4:23am UTC](https://discuss.elastic.co/t/kibanasavedobjectmeta-searchsorcejson-format/227847 "2020-04-14T04:23:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kavya12345](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@kavya12345](https://discuss.elastic.co/u/kavya12345)\
**Post date:** [April 14, 2020, 4:23am UTC](https://discuss.elastic.co/t/kibanasavedobjectmeta-searchsorcejson-format/227847/1 "2020-04-14T04:23:40Z")

</div>

Hi, I am using kibana as an iframe in angular-8 application. I have kibana savedObject something like this.

I want to know how can we parse the KibanaSavedObjectMeta.searchSorceJSON with out '' ?

What we are getting :  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"query":{"language":"kuery","query":""},"filter":,"highlightAll":true,"version":true}"  
}

I want like this without '':  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"query":{"language":"kuery","query":""},"filter":,"highlightAll":true,"version":true}"  
}

Please let me know how can i remove the '' ?  
Please help me.

Thanks in Advance.  
Kavya Nagarapu

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [April 14, 2020, 7:58am UTC](https://discuss.elastic.co/t/kibanasavedobjectmeta-searchsorcejson-format/227847/2 "2020-04-14T07:58:02Z")

</div>

The way Kibana saves its saved objects is a little convoluted. Each individual saved object (so each visualization, each dashboard and so on) is a document in a special Elasticsearch index `.kibana`. These documents contain different properties based on the saved object type. In a lot of cases the saved objects contain deeply nested and dynamic object structures (e.g. the search source definition you stumbled over). In this case, the complex part is stringified as JSON again and put into the document JSON as a simple string to simplify the object tree. So now we have JSON nested within JSON - to get to the complex object, you have to pick the inner JSON string from the outer object and parse it again:

```auto
const searchSourceJSON = myObject.kibanaSavedObjectMeta.searchSourceJSON;
const parsedSearchSource = JSON.parse(searchSourceJSON);
// access inner properties with parsedSearchSource.filter and so on
```

---

<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:** [May 12, 2020, 7:58am UTC](https://discuss.elastic.co/t/kibanasavedobjectmeta-searchsorcejson-format/227847/3 "2020-05-12T07:58:03Z")

</div>

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