Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KQL autocomplete should show existing fields and not all fields #24709

Open
ruflin opened this issue Oct 29, 2018 · 21 comments
Open

KQL autocomplete should show existing fields and not all fields #24709

ruflin opened this issue Oct 29, 2018 · 21 comments
Labels
blocked enhancement New value added to drive a business result Feature:KQL KQL impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects

Comments

@ruflin
Copy link
Member

ruflin commented Oct 29, 2018

The current Kibana autocomplete feature shows all fields which are defined in the index pattern. As Beats creates the complete index pattern with all fields on setup this means the query auto complete feature in Kibana shows all fields when starting typing even though most fields do not exist. My expected behaviour would be that by default only the fields that exist in this certain time frame would be show. Kibana seems to already have the knowledge which fields exist in the selected time frame based on the field list on the left.

My assumption is that most of the time users want to filter on fields that exist in the time frame. Otherwise they would see empty results. There could an option to turn on all fields or have Show more ... on the bottom of the list if needed.

As an example see the two screenshots below. When starting to type be I would expect only to the beats fields to show up but all show up even though there is not data for kubernetes or elasticsearch.

screen shot 2018-10-29 at 08 28 19
screen shot 2018-10-29 at 08 27 48

Reproduce

  • Run Kibana Master
  • Run ./metricbeat setup
  • Run ./metricbeat
  • Go to Kibana discovery tab
@ruflin
Copy link
Member Author

ruflin commented Oct 29, 2018

@bhavyarm bhavyarm added Feature:Discover Discover Application enhancement New value added to drive a business result labels Oct 30, 2018
@alexfrancoeur
Copy link

alexfrancoeur commented Nov 1, 2018 via email

@stacey-gammon
Copy link
Contributor

Im assuming it's matching on the be inside kubernetes. what happens if you write bea?

@stacey-gammon
Copy link
Contributor

actually nm that doesn't account for all the fields that are showing up.

@Bargs - this is a bug, not expected, right?

@stacey-gammon stacey-gammon added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Nov 1, 2018
@Bargs
Copy link
Contributor

Bargs commented Nov 1, 2018

As far as I can tell all of the fields showing have a "be" in them. I believe @ruflin is referring to the fact that fields are being suggested even if those fields don't exist in any of the documents within the given time range.

This is working as intended. We've had this debate many times before actually, dating back to when suggestions were first added to the filter editor. The counter argument is that just because a field has no results does not mean you don't want to query on it. The fact that it has no results may be surprising to you and a useful piece of information to learn. It's easier to convey that information with a 0 results screen than it is to mysteriously remove it from the suggestions, which the user may just interpret as kibana being broken.

@stacey-gammon
Copy link
Contributor

Oh good call, numBEr, memBEr. missed those.

@ruflin
Copy link
Member Author

ruflin commented Nov 2, 2018

I don't think it has be one or the other. If for example I start filtering on fields and don't see the field I'm looking for, I could click on "more ..." or "all ..", perhaps make it a config option.

If we have 20 fields and I only see 18, agree this could be confusing. But in Beats we are talking about 2000 fields and most fields are not used because the module is not enabled. Even if it's only a config option, from a Beats perspective this would be a big win.

@stacey-gammon
Copy link
Contributor

in Beats we are talking about 2000 fields and most fields are not used because the module is not enabled.

Another way to tackle this is to be able to only import/update fields in the index mapping from modules that are turned on, which has other benefits, like those fields not showing up when creating visualizations. I think this is something we want to do right? I can't remember if I had this conversation in Dublin or somewhere else. Do you know @ruflin, if there is an issue filed for this?

@Bargs
Copy link
Contributor

Bargs commented Nov 2, 2018

I'm not fundamentally opposed to a flag for turning it on and off, but we've talked about it before and failed to come up with a good way to present it to the user in a clear manner. We could put the flag at different levels (global, per index pattern, per user, per search) but I think ultimately each individual user needs to be able to control it for themselves otherwise behavior could be confusing and unexpected. So we would need a design that makes it obvious to the user which mode they're currently in, what that mode means for the suggestions they're currently seeing, and how to change it if they want.

Another possible point of difficulty is that some users have expressed a desire to have the filters in the filter bar apply to the suggestion results as well. @ruflin would you want that as well, or do you only want the time filter to apply? If only the time filter, then we're looking at trying to squeeze in three different types of suggestions.

@ruflin
Copy link
Member Author

ruflin commented Nov 5, 2018

@stacey-gammon This is something we are actively looking into to split up modules per indices. It could result in multiple index patterns in Kibana but this causes other issues. For example often a user wants to see data from the system module and the mysql module (as an example). There is no public issue for this yet as we are still figuring out the right approach on our end.

@Bargs I would also expect the filtering on the filtered results. Let me make an example which I hope also explains what an index pattern per module is not going to solve it either fully.

The user wants to see all data which comes from the system module for the cpu metricset. The filter he will apply is metricset.module: system AND metricset.name: cpu. Now when he starts typing, he see all the fields that exist in this time frame and are sent in one of the cpu documents. He will not see the memory fields which are also in the system module because he filtered on for CPU. He will also not see ticks fields for example if he didn't enable these in the Metricbeat configs and are in the actual events. The suggested values should also only be the ones available for all the filters applied.

What about packing it under the Syntax options? It would also be nice to at least have it as a feature available on the Solution side, meaning if we prefer in the solution to use the above behaviour by default, we could do that and still use the query bar but instantiate it with a different flag.

@tbragin
Copy link
Contributor

tbragin commented Nov 5, 2018

@AlonaNadler @rayafratkina @stacey-gammon @Bargs Any chance the team could discuss this during the Kibana App planning week this week and let us know where something like this this fits with priorities? As @ruflin mentioned, having this way of using KQL in the InfraOps and Logs app could help quite a bit because of the way Beats populate index patterns today.

@Bargs
Copy link
Contributor

Bargs commented Nov 5, 2018

The filter he will apply is metricset.module: system AND metricset.name: cpu. Now when he starts typing, he see all the fields that exist in this time frame and are sent in one of the cpu documents.

@ruflin in this example, is metricset.module: system AND metricset.name: cpu in the filter bar or the query bar? Or could it be either?

It would also be nice to at least have it as a feature available on the Solution side, meaning if we prefer in the solution to use the above behaviour by default, we could do that and still use the query bar but instantiate it with a different flag.

This is already doable thanks to work the APM team did. Pass in any ES query as the boolFilter param to the autocomplete provider and it'll filter the suggestion results. We could of course implement a flag to make this particular use case easier, just want to point out that it is possible today without any changes to the autocomplete code.

@ruflin
Copy link
Member Author

ruflin commented Nov 8, 2018

I normally always use the query bar. In the logging UI for example that is the only one we have. I would not expect the behaviour to be different but I might miss something here.

@Bargs Very interesting about the provider. Seems like a lot of logic already exists.

@rayafratkina
Copy link
Contributor

Quick follow up on the timing: @tbragin we discussed in the planning but unfortunately we are way overbooked at the moment. We are going to park it until next time and reconsider then.

@tbragin
Copy link
Contributor

tbragin commented Nov 18, 2018

@makwarth FYI - this is the KQL auto-complete enhancement I mentioned to you in our chat last week.

@science695
Copy link

Don't mean to bump an old issue, but is this something where, instead of hiding empty fields, prioritizing fields with data above those without?

Like showing all results, but those with active data show above a line / divider, and the others show below.

@wavded
Copy link

wavded commented Jun 30, 2021

In my case it seems even if I "exclude" fields in the index, I still see fields excluded as well in autocomplete, even though they don't show up elsewhere in the UI. Is that expected?

@timroes timroes added Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Aug 31, 2021
@ella-strandberg
Copy link

It would be nice if the exclusion of fields in the index pattern was also applied to the autocomplete as well as the suggested fields for the filters.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)

@kertal kertal removed Feature:Discover Discover Application Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) labels Aug 1, 2022
@ruflin
Copy link
Member Author

ruflin commented Jan 4, 2023

Can someone comment on what the current behaviour around this is? I think a lot of changes have happened around Data Views / Index pattern since this was last discussed. Maybe @mattkime can chime in?

How does that also work in combination with integration packages? @kpollich I just installed the k8s integration but don't see the fields show up in the data view (which is good and bad). Maybe this partially explains #148361

@lukasolson lukasolson added Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) and removed Team:AppServicesUx labels Feb 21, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kibanamachine kibanamachine added this to Inbox in Discover Feb 21, 2023
@lukasolson lukasolson changed the title Kibana autocomplete should show existing fields and not all fields KQL autocomplete should show existing fields and not all fields Feb 21, 2023
@kertal kertal added loe:medium Medium Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed triage_needed labels Mar 2, 2023
@kertal kertal added the blocked label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New value added to drive a business result Feature:KQL KQL impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
No open projects
Development

No branches or pull requests