Kibana 简明教程
Kibana - Create Dashboard
在之前的章节中,我们已经看到了如何创建垂直条形、水平条形、饼图等形式的可视化。在本章中,让我们学习如何将它们组合成仪表板。仪表板是由您创建的可视化集合,因此您可以同时查看它们。
In our previous chapters, we have seen how to create visualization in the form of vertical bar, horizontal bar, pie chart etc. In this chapter, let us learn how to combine them together in the form of Dashboard. A dashboard is collection of your visualizations created, so that you can take a look at it all together at a time.
Getting Started with Dashboard
要在 Kibana 中创建仪表板,请单击“仪表板”选项,如下所示 −
To create Dashboard in Kibana, click on the Dashboard option available as shown below −

现在,单击“创建新仪表板”按钮,如下所示。它将带我们到如下所示的屏幕 −
Now, click on Create new dashboard button as shown above. It will take us to the screen as shown below −

请注意,到目前为止,我们还没有创建任何仪表板。顶部有选项,我们可以在其中保存、取消、添加、选项、共享、自动刷新,还可以更改时间以获取仪表板上的数据。我们将单击上面显示的“添加”按钮来创建一个新仪表板。
Observe that we do not have any dashboard created so far. There are options at the top where we can Save, Cancel, Add, Options, Share, Auto-refresh and also change the time to get the data on our dashboard. We will create a new dashboard, by clicking on the Add button shown above.
Add Visualization to Dashboard
当我们单击“添加”按钮(左上角)时,它会显示我们创建的可视化,如下所示 −
When we click the Add button (top left corner), it displays us the visualization we created as shown below −

选择您要添加到仪表板的可视化。我们将选择前三个可视化,如下所示 −
Select the visualization you want to add to your dashboard. We will select the first three visualizations as shown below −

这是它们在屏幕上同时显示的方式 −
This is how it is seen on the screen together −

因此,作为用户,您能够获得我们上传的数据的总体详细信息——按国家/地区划分,包括国家/地区名称、区域名称、面积和人口字段。
Thus, as a user you are able to get the overall details about the data we have uploaded – country wise with fields country-name, regionname, area and population.
所以现在我们知道了所有可用的区域,按降序排列的每个国家的人口最多、面积最大的区域等等。
So now we know all the regions available, the max population country wise in descending order, the max area etc.
这只是我们上传的示例数据可视化,但在实际中,跟踪您业务的详细信息变得非常容易,例如您有一个每月或每天获得数百万次点击的网站,您想要跟踪每天、每小时、每分钟、每秒完成的销售额,并且如果您有 ELK 堆栈,Kibana 可以按您需要的方式每小时、每分钟、每秒在您眼前显示您的销售可视化。它会显示实际世界中正在发生的实时数据。
This is just the sample data visualization we uploaded, but in real world it becomes very easy to track the details of your business like for example you have a website which gets millions of hits monthly or daily, you want to keep a track on the sales done every day, hour, minute, seconds and if you have your ELK stack in place Kibana can show you your sales visualization right in front of your eyes every hour, minute, seconds as you want to see. It displays the real time data as it is happening in the real world.
总的来说,Kibana 在按天、按小时或每分钟提取有关您业务交易的准确详细信息方面发挥着非常重要的作用,因此公司知道进展如何。
Kibana, on the whole, plays a very important role in extracting the accurate details about your business transaction day wise, hourly or every minute, so the company knows how the progress is going on.
Save Dashboard
您可以使用顶部的“保存”按钮保存仪表板。
You can save your dashboard by using the save button at the top.

有一个标题和描述,您可以在其中输入仪表板的名称和简短描述,说明仪表板的作用。现在,单击“确认保存”以保存仪表板。
There is a title and description where you can enter the name of the dashboard and a short description which tells what the dashboard does. Now, click on Confirm Save to save the dashboard.
Changing Time Range for Dashboard
目前,您会看到显示的数据是过去 15 分钟的数据。请注意,这是一个没有时间字段的静态数据,因此显示的数据不会改变。当您将数据连接到实时系统时,更改时间也将显示反映的数据。
At present you can see the data shown is of Last 15 minutes. Please note this is a static data without any time field so the data displayed will not change. When you have the data connected to real time system changing the time, will also show the data reflecting.
默认情况下,您会看到“过去 15 分钟”,如下所示 −
By default, you will see Last 15 minutes as shown below −

单击“过去 15 分钟”,然后将显示您可选择的时段范围。
Click on the Last 15 minutes and it will display you the time range which you can select as per your choice.
请注意,有快速、相对、绝对和最新选项。以下屏幕截图显示了快速选项的详细信息 −
Observe that there are Quick, Relative, Absolute and Recent options. The following screenshot shows the details for Quick option −

现在,单击相对以查看可用的选项 −
Now, click on Relative to see the option available −

您可以在此处指定分钟、小时、秒、月、年前的起始和结束日期。
Here you can specify the From and To date in minutes , hours, seconds, months, years ago.
绝对选项具有以下详细信息 −
The Absolute option has the following details −

您可以看到日历选项,并可以选择一个日期范围。
You can see the calendar option and can select a date range.
“最新”选项将回传“过去 15 分钟”选项以及您最近选择的其他选项。选择时段范围将更新位于该时段范围内的数据。
The recent option will give back the Last 15 minutes option and also other option which you have selected recently. Choosing the time range will update the data coming within that time range.
Using Search and Filter in Dashboard
我们还可以在仪表板上使用搜索和筛选器。在搜索中,假设如果我们需要获取特定区域的详细信息,我们可以添加搜索,如下所示 −
We can also use search and filter on the dashboard. In search suppose if we want to get the details of a particular region, we can add a search as shown below −

在上述搜索中,我们使用了 Region(区域)字段,并且需要显示区域为 OCEANIA(大洋洲)的详细信息。
In the above search, we have used the field Region and want to display the details of region:OCEANIA.
我们获得以下结果 −
We get following results −

根据以上数据,我们可以说在大洋洲地区,澳大利亚人口最多,面积最大。
Looking at the above data we can say that in OCEANIA region, Australia has the max population and Area.

类似地,我们也可以添加筛选器,如下所示 −
Similarly, we can add a filter as shown below −


接下来,单击“添加筛选器”按钮,它将显示索引中提供的字段的详细信息,如下所示 −
Next, click on Add a filter button and it will display the details of the field available in your index as shown below −

选择您要在其上进行筛选的字段。我将使用 Region(区域)字段来获取亚洲地区详细信息,如下所示 −
Choose the field you want to filter on. I will use Region field to get the details of ASIA region as shown below −
保存筛选器,您应该会看到以下筛选器 −
Save the filter and you should see the filter as follows −

现在,数据将按所添加的筛选器显示 −
The data will now be shown as per the filter added −

您还可以添加更多筛选器,如下所示 −
You can also add more filters as shown below −

您可以单击“禁用”复选框来禁用筛选器,如下所示。
You can disable the filter by clicking on the disable checkbox as shown below.

您可以单击同一复选框以将其激活并激活筛选器。请注意,有一个删除按钮可用于删除筛选器。编辑按钮可用于编辑筛选器或更改筛选器选项。
You can activate the filter by clicking on the same checkbox to activate it. Observe that there is delete button to delete the filter. Edit button to edit the filter or change the filter options.
对于显示的可视化效果,您将看到如下所示的三个点 -
For the visualization displayed, you will notice three dots as shown below −

单击并显示如下所示的选项 -
Click on it and it will display options as shown below −

Inspect and Fullscreen
单击“检查”,在表格格式中为区域提供详细信息,如下所示 -
Click on Inspect and it gives the details of the region in tabular format as shown below −

还有一个选项可以以 CSV 格式下载可视化效果,以防您想在 Excel 表格中查看它。
There is an option to download the visualization in CSV format in-case you want to see it in excel sheet.
下一个选项全屏将以全屏模式获取可视化效果,如下所示 -
The next option fullscreen will get the visualization in a fullscreenmode as shown below −

您可以使用该按钮退出全屏模式。
You can use the same button to exit the fullscreen mode.
Sharing Dashboard
我们可以使用共享按钮共享仪表盘。单击共享按钮后,您将获得以下显示 -
We can share the dashboard using the share button. Onclick of share button, you will get display as follows −

您还可以使用嵌入代码在您的网站上显示仪表盘或使用永久链接,永久链接将是与他人共享的链接。
You can also use embed code to show the dashboard on your site or use permalinks which will be a link to share with others.

URL 将如下所示 -
The url will be as follows −
http://localhost:5601/goto/519c1a088d5d0f8703937d754923b84b