# Omit pinned filters that are inappropriate to a dashboard?

**URL:** https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901
**Category:** Kibana
**Created:** [May 25, 2021, 7:53am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901 "2021-05-25T07:53:55Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)
#### Post date: [May 25, 2021, 7:53am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/1 "2021-05-25T07:53:55Z")

</div>

I have developed a set of dashboards. At the top of each dashboard is a Markdown panel that contains a row of links to those dashboards.

Some dashboards can be usefully filtered by the `job_name` field, so it makes sense for users to pin a filter for `job_name`. However, the data for other dashboards does _not_ include a `job_name` field; for those dashboards, a `job_name` filter causes the dashboard visualizations to display "No results found".

User beware? Or is there a workaround?

For this use case, Kibana's implementation of persistent ("pinned") filters is unfortunate. An alternative would be to persist _variables_ across dashboards. If a query in a target dashboard refers to a variable, then that variable value is used. Otherwise, the variable is benign: rather than causing "No results found", the variable simply isn't used by that dashboard.

Fugly kludges that occur to me:

- Define a filter, saved with the dashboard, that somehow "nullifies" (cancels) any pinned filter for a specified field, for that dashboard.
- Specify something in the dashboard link URL to do as described in the previous item: nullify any pinned filter for a specified field.

Thoughts, suggestions welcome. I'd prefer to not involve a separate tool, such as [kibana-URL-filter-creator](https://github.com/gbit-is/kibana-URL-filter-creator) (nice as it looks).

---

<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: [May 25, 2021, 9:24am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/2 "2021-05-25T09:24:42Z")

</div>

There is an advanced setting `courier:ignoreFilterIfFieldNotInIndex`:

> This configuration enhances support for dashboards containing visualizations accessing dissimilar indexes. When disabled, all filters are applied to all visualizations. When enabled, filter(s) will be ignored for a visualization when the visualization's index does not contain the filtering field.

Would this cover your use case?

---

<div class="post-metadata">

### Author: ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)
#### Post date: [May 26, 2021, 1:55am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/3 "2021-05-26T01:55:28Z")

</div>

> [@flash1293](#):
>
> Would this cover your use case?

👍

Yes! Thank you for pointing out that setting to me. That works for me.

Idea (worth a feature request issue? let me know what you think): a visual cue that the filter has been ignored would be nice. (Graying-out?)

---

<div class="post-metadata">

### Author: ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)
#### Post date: [May 26, 2021, 3:25am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/4 "2021-05-26T03:25:52Z")

</div>

> [@GrahamHannington](#):
>
> a visual cue that the filter has been ignored would be nice.

I _do_ get a visual cue in the Discover tab:

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b34975c34b7a87b626ea780b1f65a4e22809386.png)

but not in a dashboard. What's going on here?

I initially thought, "This dashboard doesn't contain any visualizations that use indices that contain `job_name`". But then it occurred to me: I've got the same TSVB Markdown panel at the top of each dashboard. That panel doesn't actually perform any query—it exists only to render Markdown with custom CSS—but it still has to specify an index pattern.

Sure enough, I'd set the index pattern in the TSVB Markdown panel to an index pattern that contains `job_name`.

When I change that panel to use a different index pattern, the `job_name` filter shows "Warning".

Perhaps I should create a new topic for this, but it's an unexpected follow-on consequence of applying the solution for this topic: I'm using a TSVB panel for Markdown only because the "standard" Markdown panel doesn't support custom CSS. I don't really want to specify an index pattern for that panel; I don't want to have to risk specifying an index pattern that might interfere with that "Warning" visual cue. I've inserted that Markdown panel in numerous dashboards.

I've tried specifying a bogus index pattern (for example, the literal string `none`) in that TSVB Markdown panel, but that causes the panel to display the message "No results found" (again, I'm only using this TSVB panel because I want to apply custom CSS to static Markdown—no Handlebars expressions in this instance).

Do I need to create an "innocuous" index pattern just for this purpose? (Yuk!)

Advice welcome.

---

<div class="post-metadata">

### Author: ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)
#### Post date: [May 26, 2021, 3:38am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/5 "2021-05-26T03:38:17Z")

</div>

For now—hopefully only as a temporary stopgap—I've set the index pattern of that TSVB Markdown panel to `.kibana`. I'd already defined that as an index pattern for dev/research purposes. But I don't particularly want to deploy/distribute my dashboards with a `.kibana` index pattern as a requirement, so I'm still looking for a proper solution (to this follow-on issue).

---

<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: [May 26, 2021, 7:11am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/6 "2021-05-26T07:11:07Z")

</div>

That's kind of a gap right now - only TSVB allows to specify custom css on a dashboard at the moment. Definitely worth opening a feature request issue for the regular markdown vis to support custom css as well.

---

<div class="post-metadata">

### Author: ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)
#### Post date: [May 28, 2021, 9:38am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/7 "2021-05-28T09:38:14Z")

</div>

I've added a comment to the existing issue "[CSS controls in Markdown widget](https://github.com/elastic/kibana/issues/13313)".

---

<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: [June 25, 2021, 9:38am UTC](https://discuss.elastic.co/t/omit-pinned-filters-that-are-inappropriate-to-a-dashboard/273901/8 "2021-06-25T09:38:27Z")

</div>

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