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

[Lens/Discover/Dashboard] Support for ad-hoc data views #126911

Closed
angorayc opened this issue Mar 4, 2022 · 10 comments
Closed

[Lens/Discover/Dashboard] Support for ad-hoc data views #126911

angorayc opened this issue Mar 4, 2022 · 10 comments
Labels
enhancement New value added to drive a business result Feature:Lens Feature:Unified search Unified search related tasks Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@angorayc
Copy link
Contributor

angorayc commented Mar 4, 2022

As Lens embeddable only takes Data View id. Therefore, Lens embeddable is not compatible to the Sourcerer we have on our page, which allows users to filter the index patterns under the data view. So we are not going to replace our existing charts with Lens embeddable, we keep the existing charts and create the chart actions by ourselves.
#126507

security_solution_sourcerer.mp4

In order to keep the consistency of index patterns in Lens, I use _index filters to filter out the selected patterns from Security Solution's Sourcerer when open the chart in Lens, save Visualization, and attach to case.
Although the query is different from what we have when inspecting on Security Solution's page, this keep the result aligned.
But I'm still hoping that Lens / Lens Embeddable can take index patterns, this will allow Security Solution to use Lens Embeddable on our page with aligned queries and index patterns. We also have a plan to show custom Lens Visualization on Security Solution's page in 8.3 release, the change will empower this feature a lot. Thanks for considering.

_index_filter.mp4

Originally posted by @angorayc in #124792 (comment)

@botelastic botelastic bot added the needs-team Issues missing a team label label Mar 4, 2022
@flash1293 flash1293 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Mar 4, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Mar 4, 2022
@flash1293 flash1293 changed the title Lens embeddable takes only Data View id [Lens] Support for ad-hoc data views Mar 4, 2022
@flash1293
Copy link
Contributor

To keep this compatible with the Lens UI, we need to support ad-hoc data views in Lens (do not pick an existing data view from the list, but create it inline without saving). This has a dependency on @elastic/kibana-app-services as data views have to implement the persistable state interface so they can be embedded as part of a Lens configuration.

@mattkime
Copy link
Contributor

mattkime commented Mar 4, 2022

@angorayc Whats the best way for me to get up to speed on how data views are being used by security solution?

The request for this feature seems necessitated by the filtering of index patterns (on data views). This likely limits interoperability with other kibana apps. I'd like to make sure I understand this before creating additional functionality.

We have flexibility in how we resolve this so I'd like to make sure we're taking the widest view possible before committing to a particular implementation.

@angorayc
Copy link
Contributor Author

angorayc commented Mar 7, 2022

@mattkime , yes, in Security Solution's use cases, our data view allows users to filter index patterns under the given data view, this allow us to have better performance when loading data. However this also brings the inconsistency between Security Solution and other apps like Observability and Lens, as the data view only takes data view id. I understand that we can apply _index filter when open our charts in Lens to have the consistent result, but users may be confused as when they clicking on Inspect in Security Solution, they see the selected index patterns are applied.

Screenshot 2022-03-07 at 19 14 22

But when open the chart in Lens, they see all the index patterns under the data view id, and they have to go to they query tab to figure out actually _index is applied for selected index patterns.
Screenshot 2022-03-07 at 19 14 53
Screenshot 2022-03-07 at 19 15 06

video:

inspect.mp4

@angorayc
Copy link
Contributor Author

angorayc commented Mar 7, 2022

Please feel free to visit https://kibana.endpoint.elastic.dev/app/security/hosts/allHosts and play around with the data view. Thank you!

@angorayc
Copy link
Contributor Author

We have another use case that needs ad-hoc data views:
Host risk score over time consumes ml_host_risk_score_default index, which does not exist in kibana data view, and thus doesn't have data view id either. We prefer not to create the data view under users' behave, therefore we cannot open it in Lens atm.

Screenshot 2022-04-13 at 17 22 39

Screenshot 2022-04-13 at 17 23 08

@mattkime
Copy link
Contributor

@angorayc

We have another use case that needs ad-hoc data views:

Is this another case where you want to use lens?

@stratoula stratoula added the Feature:Unified search Unified search related tasks label Apr 13, 2022
@angorayc
Copy link
Contributor Author

@mattkime Yes, Host risk score over time is an example, but we have more charts on Security Solution that consume an index that doesn't exist in Kibana data views.

@ghudgins ghudgins changed the title [Lens] Support for ad-hoc data views [Lens/Discover/Dashboard] Support for ad-hoc data views Jun 15, 2022
@stratoula
Copy link
Contributor

@angorayc now Lens supports adhoc dataviews. Does this solve your requirements? Can we close this issue?

@angorayc
Copy link
Contributor Author

Thanks so much for the help! Using it in our current feature, looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Feature:Unified search Unified search related tasks Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants