# Disable exists query in Kibana 8.7

**URL:** https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753
**Category:** Kibana
**Created:** [April 11, 2023, 2:32pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753 "2023-04-11T14:32:08Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 11, 2023, 2:32pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/1 "2023-04-11T14:32:08Z")

</div>

Hello,

after the new controls came out and replaced the beta controls, i started to add them to every dashboard i'm managing. There was no exists query possible at all back then.

Then a new update came out, introducing the exists query, which is a nice feature to have, but for some reason it was enabled by default on every control. Even the ones already defined. Which was really annoying, as i didn't need it in a single one.  
But there was an option to disable it on a control level basis. So i went through some hundred controls and unchecked "allow exists query" on all of them.

So now i updated again, to kibana 8.7 and what do i see? It's back! On all of them!  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/6/76b78b998f91150b11b70bbcb99ff8901d6f42f9.png)  
Additionally the checkbox "allow exists query" is removed:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e504947121916ecdfd1485ef4589bd604d70d64a.png)

So i am really wondering why new kibana versions are released that change the behaviour of existing controls in a way that may be undesired.

How can i disable the exists query now? I hope i don't have to do it manually for every control again.  
Even worse would be if it is just always there. The Dashboards are used by a lot of non english speaking users who aren't really tech affine and i can already see that this will cause confusion.  
Please don't tell me i have to explain why suddenly there is a new entry in every control that we do not need at all!

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [April 15, 2023, 4:40am UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/2 "2023-04-15T04:40:42Z")

</div>

I apologize for the bad experience you have had with this. A migration should have happened that would make this change not impact scenarios like yours: [https://github.com/elastic/kibana/pull/147216](https://github.com/elastic/kibana/pull/147216)  
It looks like we have missed a bug, I will investigate locally and create an issue for it.

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 17, 2023, 12:04pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/3 "2023-04-17T12:04:53Z")

</div>

Hello @Marius_Dragomir,

so

> While the UX for the removed toggles will be removed, the logic is kept - this means that, for the Control Group API that solutions will be using, this functionality could still be exposed to the consumers.

sounds like it should still be possible to disable the exists query. Can you explain how?

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [April 17, 2023, 1:35pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/4 "2023-04-17T13:35:44Z")

</div>

@Jonas_S, I completely recognize that this is a frustrating change. The new Controls have been a little bit "under construction" for the 8.x timeframe, so adding and changing of features is to be expected. This change was intentional, and not a bug. We removed the toggle, and restored the value of `allowExistsQuery` as part of an initiative to simplify the experience of _authoring_ Controls, but I recognize that having the "exists" option there can add complexity to their usage.

When removing the toggle, we chose to reset `allowExistsQuery` back to true, because without a toggle, any user that had turned it off would be unable to turn it back on.

Right now there is no longer a way to hide the exists setting from within the Kibana UI, but there should be a way to edit the Dashboard saved objects to change these settings. If you'd like I can work on a script that can do it.

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 17, 2023, 2:10pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/5 "2023-04-17T14:10:16Z")

</div>

@devon.thomson Thank you for your answer.

I can't see how taking away options from the dashboard authors is streamlining the process. The author should be the one with the knowledge and should be given as much customization options as possible! I think you are heading in the wrong direction when you take away options from the authors.

On the other hand, the user of the dashboard are the ones which should see a "streamlined" dashboard. They should be the ones protected from unnecessary information. I think we don't need to debate this: From a data visualization standpoint, less is more. No unnecessary information is always the way to go.

But with the new version the user now always sees the exists and i already got a complaint why there is suddenly a number behind the entries in the control, which shows in how many documents the value is present. Our users don't even know what "document" means. You have to think of the older generation which are now confronted with new technology.

So i, as an author, want to control which information they should see and which they should not see. Instead, options are taken away from me.

This discussion set aside: If you can provide me with instructions (or a script if you want) that gives me control over enabling or disabling the exists query, then yes, i'd like to have it.

Edit: Also, i have more control related issues in 8.7, so maybe you know more about that as well:

> [@Kibana 8.7 expensive queries](https://discuss.elastic.co/t/kibana-8-7-expensive-queries/330120):
>
> Hello, after upgrading Elastic and Kibana to 8.7 i get reports from users that they are seeing this: [image] Combined with missing values in the control. If they type the value they are missing in the search field of the control, it shows up. So i never set anything related to expensive queries. Up until now i did not know this setting exists and prior to the 8.7 Update, this has never happened. Initially i did not notice it, because this only happens for users. With the superuser account, …

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [April 17, 2023, 4:16pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/6 "2023-04-17T16:16:46Z")

</div>

Hi @Jonas_S you're very correct that author-flexibility is important for these controls. They are meant to provide authors with a system that can simplify the experience for analysts using the dashboard. We will look into restoring this setting - perhaps at the Dashboard-level so you wouldn't have to turn it on or off for individual controls.

In the meantime, I've developed a [script](https://github.com/ThomThomson/Kibana-hide-exists/tree/main) which you can run against your cluster to hide 'exists' in all dashboards. This script might be a little complex to set up because it requires `Node`, `Yarn` and a special user role, but once you've got it running it should be pretty quick.

We'll continue the conversation about the expensive queries setting on that thread, but that setting should be `on` by default. We'll try to diagnose this with you.

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 17, 2023, 4:36pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/7 "2023-04-17T16:36:06Z")

</div>

@devon.thomson That sounds good, but i'm not sure if a dashboard-level setting is enough. What if you have a single field out of 20 where you want to have the exists query?  
So if you ask me, i would like to have a dashboard-level switch plus a control-level switch and have the dashboard-level switch control all control-level switches, but not the other way around. So you could first make the desicion if you mainly want it or not, and then go into the individual controls for fine tuning.

While we are at it, i would also suggest a similar dashboard-level setting for the sort type and direction, which is currently also a control level setting. ([Kibana 8.7 Control Sort - #3 by Hannah\_Mudge](https://discuss.elastic.co/t/kibana-8-7-control-sort/329758/3))  
@Hannah_Mudge wrote

> You do currently have to go to each control to set the default sort - after all, we support fields that don't support alphabetical sorting (for example, IP fields) and we have a range slider control that don't support the concept of sorting **at all** , so having it be a control group setting would be inconsistent and confusing.

But i think it would be great to have this as a dashboard-level setting which sets it for all controls where it is applicaple and after that you can go to the individual controls for finetuning.

But i can only appreciate that you are open to look into these desicions again! I would also appreciate an option to hide these numbers:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/7/8720274b71bd3c341dc0256e625156356e4b8051.png)  
Another thing that fits this topic well is this feature request [[Dashboard] [Controls] Field timeslider control · Issue #147460 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/147460), which you also mentioned ([[Controls] Time Picker Control Type · Issue #149846 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/149846)).  
It's also about internal information that the user/analyst doesn't need to see.

So i can only talk for myself, but i want as much control as somehow possible over the information which is eventually displayed to the user.

Your link is broken:

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

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [April 17, 2023, 5:39pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/8 "2023-04-17T17:39:07Z")

</div>

@Jonas_S, we do use the inheritance pattern you describe elsewhere, so if we were going to reintroduce these settings it would likely work in a similar way.

To track it I've opened [this issue](https://github.com/elastic/kibana/issues/155074) and have prioritized it into our next phase of the Controls project.

The link was broken because the repo was private, I've made it public, and the [link](https://github.com/ThomThomson/Kibana-hide-exists) should work properly now.

Let me know if you have any questions about running the script.

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 18, 2023, 12:50pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/9 "2023-04-18T12:50:50Z")

</div>

Thank you. @devon.thomson

I'm getting this error:

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

What exactly do i have to enter at the endpoint prompt?  
I just gave it [https://Server](https://Server) IP:9200

We have an on prem cluster if that changes anything.

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [April 18, 2023, 1:35pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/10 "2023-04-18T13:35:50Z")

</div>

Hey Jonas!

You're entering the correct format for the endpoint. it looks like it's a security configuration on your on prem cluster that's causing this issue. I ran this against a 8.7.0 cloud cluster and had no issues.

It seems like the error might be TLS related but I don't know enough about security to really help. If you have access to the yml settings, you could try temporarily setting `elasticsearch.ssl.verificationMode: certificate`.

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [April 18, 2023, 3:03pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/11 "2023-04-18T15:03:23Z")

</div>

@devon.thomson Thank you anyway. I already have an assumption but it has to do with the local setup. Maybe i can fix it.

And otherwise i hope the elastic team changed it's mind about author control and the options will be back in a future release.  
I will keep track of the issues.

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [May 2, 2023, 7:42am UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/12 "2023-05-02T07:42:59Z")

</div>

@devon.thomson  
I was able to fix the security issue, but now i'm getting this error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/4/74056972e8f48a8c4860b194e78a3543e0f15af8.png)

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [May 8, 2023, 5:14pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/13 "2023-05-08T17:14:51Z")

</div>

Hi @Jonas_S, sorry for the late reply, I've just returned from vacation.

I'm glad you were able to get around the security issue! This new one looks like I missed something when building the script. You've got a dashboard with no `controlGroupInput` at all and we need to handle that case. I've modified the script to fix this and pushed it to the repo so you can download it.

Hopefully this works for you, but if you run into any other problems I'll be around!

---

<div class="post-metadata">

### Author: ![Jonas\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_s/32/97631_2.png) [@Jonas\_S](https://discuss.elastic.co/u/Jonas_S)
#### Post date: [May 9, 2023, 12:13pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/14 "2023-05-09T12:13:19Z")

</div>

Thank you again @devon.thomson, now it worked! All Exists are gone.  
Hope it will stay like that after upgrading to new versions soon.  
But thank you for the great support!

Best regards  
Jonas

---

<div class="post-metadata">

### Author: ![devon.thomson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devon.thomson/32/85468_2.png) [@devon.thomson](https://discuss.elastic.co/u/devon.thomson)
#### Post date: [May 9, 2023, 12:45pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/15 "2023-05-09T12:45:20Z")

</div>

That's great news! We'll make sure that Control settings are not removed or reset going forward.

---

<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 6, 2023, 12:45pm UTC](https://discuss.elastic.co/t/disable-exists-query-in-kibana-8-7/329753/16 "2023-06-06T12:45:40Z")

</div>

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