Kibana 简明教程

Kibana - Create Visualization

我们可以以条形图、折线图、饼图等的格式对数据进行可视化。在本章中,我们将了解如何创建可视化。

We can visualize the data we have in the form of bar charts, line graphs, pie charts etc. In this chapter, we will understand how to create visualization.

Create Visualization

转到 Kibana 可视化,如下所示 −

Go to Kibana Visualization as shown below −

visualization

我们没有创建任何可视化,所以它显示空白,并且有一个按钮用于创建一个可视化。

We do not have any visualization created, so it shows blank and there is a button to create one.

单击屏幕上显示的按钮 Create a visualization ,它会把你带到屏幕,如下所示 −

Click the button Create a visualization as shown in the screen above and it will take you to the screen as shown below −

create visualization

在此,你可以选择可视化数据所需的选项。我们将在接下来的章节中详细了解每一个选项。现在,我们将选择饼图作为开始。

Here you can select the option which you need to visualize your data. We will understand each one of them in detail in the upcoming chapters. Right now will select pie chart to start with.

pie chart

选择可视化类型后,你现在需要选择你想要处理的索引,它会把你带到屏幕,如下所示 −

Once you select the visualization type, now you need to select the index on which you want to work on, and it will take you the screen as shown below −

visualization type

现在我们有了一个默认的饼图。我们将使用 countriesdata-28.12.2018 获取饼图格式中国家数据中可用的区域数量。

Now we have a default pie chart. We will use the countriesdata-28.12.2018 to get the count of regions available in the countries data in pie chart format.

Bucket and Metric Aggregation

左侧有我们选择为计数的指标。在桶中,有两个选项,拆分切片和拆分图表。我们将使用拆分切片选项。

The left side has metrics, which we will select as count. In Buckets, there are 2 options Split slices and split chart. We will use the option Split slices.

bucket metric aggregation

现在,选择“拆分片段”,它将显示以下选项 −

Now, select Split Slices and it will display following options −

split slices

现在,选择聚合项“项”,它将显示更多选项,可以输入如下 −

Now, select the Aggregation as Terms and it will display more options to be entered as follows −

aggregation as terms

字段下拉框将包含从索引 countriesdata 中选择的所有字段。我们已选择 Region 字段和 Order By。请注意,我们已为 Order By 选择 count 指标。我们将按照降序对其排序,大小设定为 10。这意味着,我们将从 countries 索引中获取排名前 10 的区域计数。

The Fields dropdown will have all the field from the index:countriesdata chosen. We have chosen the Region field and Order By. Note that we have chosen, the metric Count for Order By. We will order it Descending and the size we have taken as 10. It means here, we will get the top 10 regions count from the countries index.

现在,单击如下所示的高亮分析按钮,您应会看到右侧已更新的饼图。

Now, click the analyse button as highlighted below and you should see the pie chart updated on right side.

analyse button

Pie chart display

pie chart display

所有区域均列在右上角,并带有颜色,饼图中会显示相同颜色。如果您将鼠标悬停在饼图上,它会显示区域计数和区域名称,如下所示 −

All the regions are listed at the right top corner with colours and the same colour is shown in the pie chart. If you mouse over the pie chart it will give the count of the region and also the name of the region as shown below −

因此,它告诉我们 22.77% 的区域由撒哈拉以南非洲占领,数据是我们上传的国家数据。

So it tells us that 22.77% of region is occupied by Sub-Saharan Afri from the countries data we have uploaded.

countries data
countries data uploaded

亚洲地区占 12.5%,数量为 28。

Asia region covers 12.5% and the count is 28.

现在,我们可以通过单击如下所示的右上角的保存按钮来保存可视化。

Now we can save the visualization by clicking on the save button on top right corner as shown below −

new visualization
save visualization

现在,保存可视化,以便以后使用。

Now, save the visualization so that it can be used later.

我们还可以使用如下所示的搜索选项获取所需数据 −

We can also get the data as we want by using the search option as shown below −

search visualization

我们已筛选出以 Aus * 开头的国家的相关数据。在后续章节中,我们将进一步了解饼图和其他可视化。

We have filtered data for countries starting with Aus*. We will understand more on pie-chart and other visualization in the upcoming chapters.