如何在Kibana中列出特定字段的唯一值 [英] How to list unique values of a particular field in Kibana

查看:782
本文介绍了如何在Kibana中列出特定字段的唯一值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Elasticsearch数据库中有一个名为rpc的字段,并使用Kibana显示它.当我在类似kibana的搜索栏中搜索时:

I am having a field named rpc in my elasticsearch database and I am displaying it using Kibana. When I search in search bar of kibana like:

rpc:*

它显示rpc字段的所有值,但我只想显示唯一的那些值.

It display all the values of rpc field but I want to have only those value to be displayed which are unique.

推荐答案

从几周以来,我一直在和Kibana4玩耍.我发现它直观且简单,到目前为止,体验一直很棒.提出您的问题后,我尝试通过数据表可视化获得独特的结果.为什么?因为我个人觉得比较容易理解.步骤如下:

I have been playing around with Kibana4 since a couple of weeks now. I find it intuitive and simple and the experience has been great till now. Following your question, I tried getting unique results via a Data Table visualization. Why? Because I personally find it easier to understand. Following are the steps:

创建可视化(Visualize->数据表).首先让我们得到 我们在特定字段中拥有多少个唯一条目的计数 (我们将在后面的部分中使用它进行验证).我正在使用 clientip.raw,但正如我所见,它可以在任何友好的环境下正常工作 字段名称也是如此.

Create the visualization (Visualize -> Data Table). First lets get the count of how many unique entries we have for a particular field (We will use this in the later part for verification). I'm using clientip.raw but as I see, it will work just fine with any friendly field name too.

将您的汇总返回到 count ,并具有一个分割行,如下所示.如果不执行此操作,则在填充表格时,每个字段值都会给您计数1(因为它正在查找唯一计数).值得注意的是将 Top 字段设置为 0 .因为Kibana不允许您输入数字以外的任何东西(很明显!).这是棘手的部分.点击应用",您将获得结果.唯一字段值以及每个字段的计数.

Set you aggregation back to count and have a Split Rows as follows. Not doing this will give you count 1 for each field value (since it is looking for unique counts) when you populate the table. Noteworthy part is setting the Top field to 0. Because Kibana won't let you enter anything else than a digit (Obviously!). This was the tricky part. Hit Apply and you'll get the results. Unique field values and the count of each of them.

转到表格的最后一页,我们看到有543个结果.这就是我知道它起作用的方式.

Going to the last page of the table, we see there are exactly 543 results. This is how I know it works.

您保存此可视化并将其添加到仪表板.您随时可以在此处查看请求,查询,响应和其他统计信息.

You save this visualization and add it to a Dashboard. There you can always check the request, query, response and other stats.

这篇关于如何在Kibana中列出特定字段的唯一值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆