How to list unique values of a particular field in Kibana

后端 未结 3 1411
无人共我
无人共我 2020-12-23 11:10

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:*
         


        
3条回答
  •  半阙折子戏
    2020-12-23 11:50

    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:

    1. Get unique count

    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.

    2. Set the aggregation right

    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.

    3. Verification:

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

    What Next?

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

提交回复
热议问题