Kibana dashboard filters that recognize multiple views?

I created a dashboard that shows visualizations . Each visualization references a different Kibana data view. And each kibana data view references a different index.

For example, let's say I have two indices with the following mappings:

timesheet: project_id, assignment_id, billable_hours
cost_estimate: project_id, assignment_id, dollar_amount

Then I made two Kibana views that have the same name as the indices and also use the same mappings.

Then I went to Kibana dashboards and made a few visualizations. For example:

Bar Graph with X-Axis showing timesheet.assignment_id and Y-Axis showing SUM(timesheet.billable_hours)
Bar Graph with X-Axis showing cost_estimate.assignment_id and Y-Axis showing SUM(cost_estimate.dollar_amount)

Then I went back to my dashboard to see all the visualizations. Then I went to this filter:

And I tried to make this expression

timesheet.project_id == 2012 OR cost_estimate.project_id == 2012

But Kibana will only accept ONE of either timesheet.project_id == 2012 (as shown in red highlight) OR cost_estimate.project_id == 2012 (as shown in purple highlight)

How do I make an OR statement across both data views? Is it even possible

If not, how would I go about having a dashboard that can do something similar? As a last resort, I could have one index like this:

content: project_id, assignment_id, content_type, billable_hours, dollar_amount

Where the field content_type can be the value timesheet or cost_estimate.

Yeah each filter is associated with a dataview so you won't be able to do it, only if you have all fields to one dataview.

Hi @learningelastic,

It's not possible inside filters UI but there are some other options as Stratoula mentioned:

  1. Create a data view which targets both indices at once instead of 2 data views per index. It can be achieved by entering an index pattern like the following timesheet,cost_estimate. Then it would be possible to build a single filter for project_id field for such combined data view.

  2. Or make use of KQL search input with AND/OR logic. But in this case you would need to use index name instead of a data view name. Example of a query across 2 different indices and data views:


Thanks you

For your suggestion 2, I see the query

_index: "kibana_sample_data_flights" AND DestCityName: "Barcelona" or extension.keyword: "css"

If I understand correctly, the [Flights] Flight Log is a visualization that references the index kibana_sample_data_flight directly and doesn't use a Kibana Data View? Or does the [Flights] Flight Log also use a Kibana Data View that references the kibana_sample_data_flight directly? Or does that matter? Trying to understand meaning/consequences of mixing and matching of views and indices in queries like these

It was an example of using AND/OR logic together with _index (index name) to filter out some results if necessary. _index part can be also skipped of course.

[Flights] Flight Log is a saved search from Discover page. It uses Kibana Sample Data Flights data view which targets kibana_sample_data_flight index. And [Logs] Visits uses Kibana Sample Data Logs data view in this case.

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