# Source Filtering for all index patterns

**URL:** <https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628>\
**Category:** Kibana\
**Created:** [January 10, 2020, 3:57pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628 "2020-01-10T15:57:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lantern77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lantern77/32/22043_2.png) [@lantern77](https://discuss.elastic.co/u/lantern77)\
**Post date:** [January 10, 2020, 3:57pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/1 "2020-01-10T15:57:21Z")

</div>

Hello,

So we have a very large nested field that contains alot of objects, and on the "discover" page for kibana whenever it appears, the application crashes.  
I am aware that source filtering exists for index patterns [https://github.com/elastic/kibana/issues/4366](https://github.com/elastic/kibana/issues/4366) and it works perfectly fine. However is there a way to **add in the source filter for every index pattern created from here on out automatically?**  
Now we can also exclude the field from \_source using [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html) However we lose the ability to debug and see the data when querying in elasticsearch. Which is something we don't want.

I know this is a specific use case, but does anyone have a solution for this?

Regards

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [January 10, 2020, 6:06pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/2 "2020-01-10T18:06:27Z")

</div>

Unfortunately, there does not appear to be an automated way of doing this out-of-the-box with Kibana.

The semi-automatic solution I can think of is to use the [SavedObjects API](https://www.elastic.co/guide/en/kibana/7.5/saved-objects-api.html) to modify index patterns programmatically to add the source filtering settings.

That said, I'm interested to know why you might be creating index patterns very often. Is it not possible to use a broader index pattern that can match many of your indices? This way you don't need to create these often.

---

<div class="post-metadata">

**Author:** ![lantern77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lantern77/32/22043_2.png) [@lantern77](https://discuss.elastic.co/u/lantern77)\
**Post date:** [January 10, 2020, 6:13pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/3 "2020-01-10T18:13:05Z")

</div>

Well we aren't creating them often enough where this could be a problem. But I was worried about a case where if a user just decided to create a \* index pattern(or some index pattern) and on the discovery page the document appeared, it would crash kibana with it being difficult to reproduce.  
An extreme edge case.

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [January 10, 2020, 6:19pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/4 "2020-01-10T18:19:36Z")

</div>

Right, there is a risk that that could happen. I would recommend leveraging the Spaces & Security features to only give access to creating index patterns to the proper users. That way, only admins can potentially do this + if a bad index pattern does get created, it's isolated to a single space.

---

<div class="post-metadata">

**Author:** ![lantern77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lantern77/32/22043_2.png) [@lantern77](https://discuss.elastic.co/u/lantern77)\
**Post date:** [January 10, 2020, 6:41pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/5 "2020-01-10T18:41:23Z")

</div>

Thanks I will give that a try!

---

<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:** [February 7, 2020, 6:41pm UTC](https://discuss.elastic.co/t/source-filtering-for-all-index-patterns/214628/6 "2020-02-07T18:41:32Z")

</div>

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