elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

Visualizing sql query in Kibana #136740

Closed alexisimp closed 7 months ago

alexisimp commented 2 years ago

Describe the feature: Hello! I have some indices with following fields

status: ["Failed", "Succeeded", "None"]
user_id:  user_id

I want to get events with status None if they are not in Succeeded set. This can be checked by user_id. So I need to collect all user_ids for status=Succeeded and check if the user_id of a None is not in that set. Similar to this sql query:

SELECT d FROM   data d
WHERE  d.status = 'None'
       AND d.user_id NOT IN (SELECT user_id FROM data WHERE status = 'Succeeded');

I need to do some visualization on this specific set. I searched a lot and it seems that Kibana does not support such queries that include IN keyword. Having this feature would be great!

elasticmachine commented 2 years ago

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

stratoula commented 1 year ago

This will be possible with ESQL in the future.

ebuildy commented 1 year ago

Edit: ho I see this is in tech preview from https://github.com/elastic/kibana/pull/140469 , just enable it and woaaaaa, nice job guys!!!

hey @stratoula any workaround for now? (I am thinking maybe this is possible to generate a new index from SQL query results)

SQL is so useful.

many thanks

stratoula commented 7 months ago

I am closing this as ES|QL is available in 8.11 in kibana!