When you were using Kibana, did you ever think of creating a Dashboard control that lets you easily filter data without typing a string into the search bar? For example, the Flight example in Kibana has this control:
In the input box above, we just need to select the starting city and the ending city, and select the average ticket price, then we can find the data we want, and the visual controls in the Dashboard will be changed accordingly. In a way, it actually simplifies our search in the input field, making our search more user-friendly. For users unfamiliar with KQL and Lucene, our Dashboard is also very convenient to use.
Here’s an example to show how to create our own control.
To prepare data
Open Kibana:
Load a dataset and a Kibana Daashboard:
Click Add Data to Add the Sample Flight Data dataset:
It says our data has been loaded. Then we try to open the Dashboard of the index:
Click on the link above to show [Flights] Control:
We randomly choose a starting city and a destination city, and set the average ticket price. We can find all the Dashboard displays of queries that compound these criteria.
In the following example, we will use the same dataset to create a control of our own.
Hands-on practice
Create a personalized control
We click Visualization in Kibana:
Select Controls:
As shown above, this is currently a test feature. Since we want an Options list, we just hit the Add button:
We choose the actual country. Fill in the corresponding information as described above. Since we don’t want to use Multiselect, so disable Multiselect. Click on the Update:
This forms a list of Origin Country options for us to choose easily. In the same way, we create an option called Destination Country:
Fill in the corresponding information as described above and click the Update button:
This forms our list of options for one Destination Country. This is very similar to what we showed before.
Next, we add another range control:
We select the Range Slider first instead of the Options List. Click the Add button above:
Let’s enter with the above information and click the Update button:
So our final control has been designed. We click the Save button above and Save the current Visualization:
To distinguish the existing [Flights] Control, we name the visualization [Flights] Control1. Click the Save button to Save.
Use Control in Dashboard
We open Dashboard the same way we did before:
We click on the Edit link above:
Click on the Add link:
Select [Flights] Control1 which we have created earlier:
We adjust the visualization of the [Flights] Control1 we just imported at the bottom of the screen. Let’s go back to the Dashboard and save:
So our integration is complete. Let’s scroll down to the bottom of the screen to manipulate the visual controls we’ve created:
We can see that the data in the list above immediately changed. If we scroll to the top of the screen, we can see:
It automatically loads the desired filter onto it. If we want to know how each filter works, we can follow the following steps to see:
This is the specific DSL for each filter.
All right, that’s it for today. Hopefully you learned something and will be able to use this feature in a future interface.