Kibana 简明教程

Kibana - Creating Reports Using Kibana

可以通过使用 Kibana UI 中提供的“共享”按钮轻松创建报告。

Reports can be easily created by using the Share button available in Kibana UI.

Kibana 中的报告具有以下两种形式 −

Reports in Kibana are available in the following two forms −

  1. Permalinks

  2. CSV Report

在执行可视化时,您可以按以下方式共享 −

When performing visualization, you can share the same as follows −

report permalinks

使用“共享”按钮以嵌入代码或永久链接的形式与他人共享。

Use the share button to share the visualization with others as Embed Code or Permalinks.

在嵌入代码的情况下,您获得以下选项 −

In-case of Embed code you get the following options −

embed code

您可以为快照或已保存对象生成 iframe 代码作为短网址或长网址。快照不会提供最新数据,用户将能够查看在共享链接时保存的数据。稍后进行的任何更改将不会反映在内。

You can generate the iframe code as short url or long url for snapshot or saved object. Snapshot will not give the recent data and user will be able to see the data saved when the link was shared. Any changes done later will not be reflected.

在已保存对象的情况下,您将获得对该可视化所做的最新更改。

In case of saved object, you will get the recent changes done to that visualization.

针对长网址的快照 IFrame 代码 −

Snapshot IFrame code for long url −

<iframe src="http://localhost:5601/app/kibana#/visualize/edit/87af
cb60-165f-11e9-aaf1-3524d1f04792?embed=true&_g=()&_a=(filters:!(),linked:!f,query:(language:lucene,query:''),
uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(field:Area),schema:metric,type:max),(enabled:!t,id:'2',p
arams:(field:Country.keyword,missingBucket:!f,missingBucketLabel:Missing,order:desc,orderBy:'1',otherBucket:!
f,otherBucketLabel:Other,size:10),schema:segment,type:terms)),params:(addLegend:!t,addTimeMarker:!f,addToo
ltip:!t,categoryAxes:!((id:CategoryAxis-1,labels:(show:!t,truncate:100),position:bottom,scale:(type:linear),
show:!t,style:(),title:(),type:category)),grid:(categoryLines:!f,style:(color:%23eee)),legendPosition:right,
seriesParams:!((data:(id:'1',label:'Max+Area'),drawLi
nesBetweenPoints:!t,mode:stacked,show:true,showCircles:!t,type:histogram,valueAxis:ValueAxis-1)),times:!(),
type:histogram,valueAxes:!((id:ValueAxis-1,labels:(filter:!f,rotate:0,show:!t,truncate:100),name:LeftAxis-1,
position:left,scale:(mode:normal,type:linear),show:!t,style:(),title:(text:'Max+Area'),type:value))),title:
'countrywise_maxarea+',type:histogram))" height="600" width="800"></iframe>

针对短网址的快照 IFrame 代码 −

Snapshot Iframe code for short url −

<iframe src="http://localhost:5601/goto/f0a6c852daedcb6b4fa74cce8c2ff6c4?embed=true" height="600" width="800"><iframe>

如快照和快照网址所示。

As snapshot and shot url.

短网址使用 −

With Short url −

http://localhost:5601/goto/f0a6c852daedcb6b4fa74cce8c2ff6c4

关闭短网址,链接看起来如下 −

With Short url off, the link looks as below −

http://localhost:5601/app/kibana#/visualize/edit/87afcb60-165f-11e9-aaf1-3524d1f04792?_g=()&_a=(filters:!(
),linked:!f,query:(language:lucene,query:''),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(field:Area),
schema:metric,type:max),(enabled:!t,id:'2',params:(field:Country.keyword,missingBucket:!f,missingBucketLabel:
Missing,order:desc,orderBy:'1',otherBucket:!f,otherBucketLabel:Other,size:10),schema:segment,type:terms)),
params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,categoryAxes:!((id:CategoryAxis-1,labels:(show:!t,trun
cate:100),position:bottom,scale:(type:linear),show:!t,style:(),title:(),type:category)),grid:(categoryLine
s:!f,style:(color:%23eee)),legendPosition:right,seriesParams:!((data:(id:'1',label:'Max%20Area'),drawLines
BetweenPoints:!t,mode:stacked,show:true,showCircles:!t,type:histogram,valueAxis:ValueAxis-1)),times:!(),
type:histogram,valueAxes:!((id:ValueAxis-1,labels:(filter:!f,rotate:0,show:!t,truncate:100),name:LeftAxis-1,
position:left,scale:(mode:normal,type:linear),show:!t,style:(),title:(text:'Max%20Area'),type:value))),title:'countrywise_maxarea%20',type:histogram))

当您在浏览器中点击上述链接时,您会获得与上文所示相同的可视化。上述链接是本地托管的,因此在本地环境外使用时不起作用。

When you hit the above link in the browser, you will get the same visualization as shown above. The above links are hosted locally, so it will not work when used outside the local environment.

CSV Report

您可以在 Kibana 中获取 CSV 报告,其中有数据,该数据通常位于“发现”选项卡中。

You can get CSV Report in Kibana where there is data, which is mostly in the Discover tab.

转到“发现”选项卡,然后获取您需要数据的任何索引。在此,我们取了索引:countriesdata-26.12.2018。以下是从索引显示的数据:

Go to Discover tab and take any index you want the data for. Here we have taken the index:countriesdata-26.12.2018. Here is the data displayed from the index −

csv report

您可以创建如下所示的表格数据:

You can create tabular data from above data as shown below −

csv tabular data

我们从“可用字段”中选择了字段,而之前看到的则转换为表格格式。

We have selected the fields from Available fields and the data seen earlier is converted into tabular format.

您可以通过如下所示方式获取CSV报告中的上述数据:

You can get above data in CSV report as shown below −

csv report shown

共享按钮有CSV报告和永久链接选项。您可以单击“CSV报告”并下载。

The share button has option for CSV report and permalinks. You can click on CSV Report and download the same.

请注意,要获取CSV报告,您需要保存数据。

Please note to get the CSV Reports you need to save your data.

csv save search

确认“保存”,然后单击“共享”按钮和CSV报告。您会看到如下显示:

Confirm Save and click on Share button and CSV Reports. You will get following display −

csv display

单击“生成CSV”以获取报告。完成后,它会指示您转到管理选项卡。

Click on Generate CSV to get your report. Once done, it will instruct you to go the management tab.

转到“管理”选项卡→报告

Go to Management Tab → Reporting

management tab

它显示报告名称、创建时间、状态和操作。您可以单击上面突出显示的下载按钮,获取CSV报告。

It displays the report name, created at, status and actions. You can click on the download button as highlighted above and get your csv report.

我们刚刚下载的CSV文件如下所示:

The CSV file we just downloaded is as shown here −

csv file downloaded