In Kibana, we can easily visualize entire data. We can use the Time picker to adjust the time window. We can also search the data in Dashboard (KQL or Lucene), or set filter in Dashboard to collect some data. But is it possible that in Dashboard, we don’t need to search or use filter, but our visualization can also display some data visualization statistics? In today’s presentation, we’ll show how to do this.
To prepare data
In today’s presentation, we will use the data that comes with Kibana:
This creates the KiBANA_SAMple_datA_FLIGHTS index in Elasticsearch and generates the corresponding Dashboard.
Methods a
In the first way, we can search and save the visualization directly during production. Our goal is to show the average price of a flight from China, and that metric will become part of the Dashboard, perhaps because we are Chinese and care more about the price in China.
First open Kibana:
From the graph above, we can see that the price of planes departing from China in the past year is lower than the average price of all planes of $612.34. We click the Save button above and give it a name:
When we add the visualizations we saved above to Dashboard, it naturally just shows prices in China.
Method 2
We can also visualize it in a filtered data set. The specific steps are as follows:
We first use filter or direct search in Discover. This forms a subset of the original data. We click the Save button:
We give it a name and click Save.
Next, let’s visualize the saved data set:
We select the previously saved data set for visual production:
This time, we can see the correct average price of a flight from China, but unlike the above method, we do not need to type OriginCountry: CN in the search box to search. It just shows the average price in China. We click the Save button and Save the current visualization:
Thus, we have generated the visualization we want.
Display it in Dashboard
Let’s add the visualizations we just generated to the Dashboard:
Let’s add the two visualizations we just generated to the Dashboard:
From the above figure, we can see that we no longer need to use OriginCountry: CN to search in Dashboard to intuitively see the price of air tickets in China. Otherwise, according to the previous Dashboard, we can also get the price in China, such as:
There are two questions:
- It requires us to manually search for China: OriginCountry :CN
- When we look at the entire Dashboard it has changed, all the views are Chinese. That may not be what we want in certain situations. We can watch what’s happening globally, for example, and see what’s happening to tickets in China without wanting to change Dashboard.
All right. That’s all for today’s analysis. I hope you learned what you wanted.