# Grabbing objects from Kibana Saved Object Meta

**URL:** <https://discuss.elastic.co/t/grabbing-objects-from-kibana-saved-object-meta/94398>\
**Category:** Kibana\
**Created:** [July 24, 2017, 9:45pm UTC](https://discuss.elastic.co/t/grabbing-objects-from-kibana-saved-object-meta/94398 "2017-07-24T21:45:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeyMarinello](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@JoeyMarinello](https://discuss.elastic.co/u/JoeyMarinello)\
**Post date:** [July 24, 2017, 9:45pm UTC](https://discuss.elastic.co/t/grabbing-objects-from-kibana-saved-object-meta/94398/1 "2017-07-24T21:45:11Z")

</div>

Hello everyone!

I am working on a project that uses saved search objects in Kibana to construct queries to Elasticsearch queries. I have successfully been able to extract titles, columns, and sort details from saved search objects and inject them into a template query I am using to return raw data from the cluster - woot!

My last step in this project is snagging the "must" and "must not" objects used for filtering specific values from the KibanaSavedObjectMeta. I guess I'm currently stuck figuring out how to parse the "searchSourceJSON" into an object so I can grab the field values I need to filter on for each specific saved search. Could someone offer me some insight on how to correctly go about this?

Just for reference, this is the current template query I am building on using extracted objects

```
REQUEST BODY QUERY:
{
    "query": {
        "filtered": {
            "query": {
                "query_string": {
                    "analyze_wildcard": true,
                    "query": "*",
                    "lowercase_expanded_terms": false
                }
            },
            "filter": {
                "bool": {
                    "must": [
                    ],
                    "must_not": [
                    ]
                }
            }
        }
    },
    "size": 50000,
    "sort": [
    ],
    "_source": ["*"]
};

```

And a quick thank you to the Elastic team! Your documentation and personal replies have been incredibly helpful. Cheers to you all! 🙂

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [July 24, 2017, 10:15pm UTC](https://discuss.elastic.co/t/grabbing-objects-from-kibana-saved-object-meta/94398/2 "2017-07-24T22:15:42Z")

</div>

What problems are you having with the filter values? Maybe you could share one you're not sure how to parse?

The gist is this; there are 3 ways that filters can be applied to a saved vis:

- Query bar: This will show up as `query.query_string`. Anything the user types in the query bar at the top will be converted to an Elasticsearch query DSL for you, on that key, in the `kibanaSavedObjectMeta.searchSourceJSON` property.
- Filter bar: This actually works similar, but it will add a `filter` property to `kibanaSavedObjectMeta.searchSourceJSON`, which again is simply the Elasticsearch query DSL that you can use directly.
- Saved search: If your visualization was built on a saved search, then you won't have much in `kibanaSavedObjectMeta.searchSourceJSON`, besides any filters or query\_string queries that have been applied. In this case, you will see a `savedSearchId` property with an ID that related to the saved search object. You can GET that record and use the `kibanaSavedObjectMeta.searchSourceJSON` from that object (merging it with any values in the visualization itself).

Hopefully that's helpful.

---

<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:** [August 21, 2017, 10:15pm UTC](https://discuss.elastic.co/t/grabbing-objects-from-kibana-saved-object-meta/94398/3 "2017-08-21T22:15:43Z")

</div>

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