In this tutorial, you will experience the Discover feature of Kibana, including filtering data (adding filters under the query bar or filtering using KQL syntax in the query bar), and saving and exporting the search results as a CSV report.
Alibaba Cloud Elasticsearch is based on the open-source Elasticsearch and is designed for search and analytics scenarios. It supports enterprise-level access control, security monitoring, and automatic updates.
Alibaba Cloud Elasticsearch is compatible with the open-source Elasticsearch. It optimizes kernel performance, and provides commercial features (formerly X-Pack) that are out-of-the-box (OFTB), highly available, and scalable.
For more information, see What is Alibaba Cloud Elasticsearch?
Before you begin the tutorial, follow these steps to prepare your environment and resources.
Note
Before you perform subsequent operations, make sure that you have created an Elasticsearch cluster, logged on to Kibana, and added sample flight data. For more information, see How to Create an Alibaba Cloud Elasticsearch Cluster and Log on to the Kibana Console.
There are several ways to query your data in Kibana, including:
1. On the homepage of the Kibana console, click the icon in the upper-left corner and select Analytics > Discover.
2. In the upper-left corner, select Data View as Kibana Sample Data Flights.
3. Click the time range filter in the upper-right corner. Select Relative and set 10 days ago in the From field, to Now as shown in the figure and click next to the filter.
4. Select either method to complete data filtering.
a) In the list of fields on the left, click DestWeather to view the most common values for the field.
b) On the list of values, click next to Cloudy value, which creates a filter on this value. The added filter appears at the top under the search bar.
Now the results table only shows flights where the destination weather was cloudy as shown.
c) Click on the left of the query bar towards the top of the screen. Selsect the Cancelled field, is for the Operator, and then select true for the Value. Click Add filter.
Then the results table shows cancelled flights.
d) Click the filter just created Cancelled: true > Exclude Results to only display the uncancelled flights.
e) Add a filter with the carrier Logstash Airways or JetBeats as shown.
f) Finally, add a filter for flight delays between 1 and 100 minutes.
The complete filtering results are shown in the following figure.
a) In the top query bar of the Kibana homepage, enter the following query and press Enter.
DestWeather : "Cloudy"
The number of hits (in the upper-left corner of the date histogram) changes when filtering flights where the destination weather was cloudy.
b) Add the condition on flight not being cancelled to the query.
and not Cancelled : true
or
and Cancelled : false
c) Add the conditions on carrier and restrict flight delay conditions to the query.
and Carrier : ("Logstash Airways" or "JetBeats") and FlightDelayMin>0 and FlightDelayMin<=100
d) Now the complete query should be as follows.
DestWeather : "Cloudy" and not Cancelled : true and Carrier : ("Logstash Airways" or "JetBeats") and FlightDelayMin>0 and FlightDelayMin<=100
KQL is a powerful query language that allows you to search freely on any field. For example, and Thunder*
is able to search for Thunder*
in any field and it will match the origin or destination weather. For more information about the KQL syntax, visit Kibana Query Language.
In this section, you will customize the table view, and save it as a saved search.
1. In the top right navigation bar, click Create to reset the filter and query settings.
2. Expand one of the documents with the arrow on the left of a line and switch to a dialog with details as shown.
3. Create a custom table view that contains only certain fields.
In the Document Details dialog box, click Fields OriginCityName, DestCityName, Carrier, and FlightDelayMin in the Actions column. (Switch columns in the table.)
4. Use the Add Filter under Query Bar or KQL syntax method in the previous link to filter for delayed flights.
The field that identifies whether the flight is delayed is FlightDelay. If the KQL syntax is FlightDelay : true
, press Enter to query.
5. Click Save in the upper-right corner of the page. In the Save Search dialog box, enter a Delayed flights saved search in the Title field and click Save.
6. In the top navigation bar, click New to reset the table view to the original view.
7. Click Open in the top navigation bar and select Delayed flights saved search to return to your saved search.
1. Open the Delayed flights saved search.
2. In the top navigation bar, choose Share > CSV Report > Generate CSV.
On the Kibana homepage, click the icon in the upper-left corner and choose Stack Management > Alerts and Insights > Reporting to view the download progress.
3. After the CSV is generated, a pop-up message appears in the lower-right corner of the page.
You can click Download Report or click the icon in the upper-left corner of the Kibana homepage and choose Stack Management > Alerts and Insights > Reporting.
After completing the above operations, you have completed the data filtering based on the Kibana Sample Data Flights data view, saving and exporting the search results as a CSV report, as shown in the image.
Resources that are charged based on the subscription billing method have validity periods. After the validity periods elapse, the resources are automatically released. After you complete the tutorial, you can refer to the following instructions to process the resources:
If you no longer require the test data and resources used in the tutorial, you can delete them.
DELETE /product_info
- Delete the VPC. For more information, see Delete a VPC.
{
"acknowledged" : true
}
Based on the created instance, you can try other tutorials of the search and analysis service for Elasticsearch to experience the data visualization feature of Kibana Discover and the basic search feature of Alibaba Cloud Elasticsearch.
How to Create an Alibaba Cloud Elasticsearch Cluster and Log on to the Kibana Console
Data Geek - July 18, 2023
Alibaba Cloud Indonesia - August 1, 2023
Alibaba Cloud Community - September 1, 2023
Data Geek - May 13, 2024
Data Geek - April 30, 2024
Data Geek - May 13, 2024
Alibaba Cloud provides big data consulting services to help enterprises leverage advanced data technology.
Learn MoreAlibaba Cloud experts provide retailers with a lightweight and customized big data consulting service to help you assess your big data maturity and plan your big data journey.
Learn MoreAlibaba Cloud Elasticsearch helps users easy to build AI-powered search applications seamlessly integrated with large language models, and featuring for the enterprise: robust access control, security monitoring, and automatic updates.
Learn MoreTransform your business into a customer-centric brand while keeping marketing campaigns cost effective.
Learn MoreMore Posts by Data Geek