Want to Count the Total Occurence of Field values


(Aditya Soni) #1

Hi all,
I need to make a visualization in which i have to get a total count of a field occurence.
For Ex.i had applied a metric count on terms Response Code field but i get individual Response Code counts i.e.

91=5 times.
100-6 times.
12-4 times


total- 15

so i just want to create the panel(Data table) which should be something like this.

Response Code Count(Column name)
          15 (Its data)

so how can i do that in kibana? is there any way i can write my own customize calculation for creating visualization?


(Tim Roes) #2

Hello Aditya,

I don't understand exactly what you want to visualize. You just want to visualize the number of documents, that had any kind of value in the (let's call it): responseCode field, no matter what the value was?

In this case, you could just create a metric aggregation (which doesn't require splitting into any buckets or such), and apply the query _exists_:responseCode in the query bar on top of the visualization and leave the metric aggregation in the editor to "Count". That way the number will just show the amount of documents, that had a specific value in that column.

For your second question: You can basically write custom visualizations in JavaScript and plug them into Kibana. But this is still a of of trial and error, since we don't expose a proper API at the moment for that. Best would be to have a look at existing plugins and check what they are doing.

Cheers,
Tim


(Aditya Soni) #3

HI @timroes,

Thanks For your answer it is helpful for me to go a step ahead.
Now i am able to count the Number of Response Code Occurence according to my condition by applying the Filters.
So my next problem is,
Since i have created the column Declines (count of Transaction that has Response Codes other than 0) below, Now i have to create a column with name Total(Total transaction which has Response Code 0 as well as response Code =anynumber),
So For doing that i have to create a new metric Count, and i want to apply only the ResponseCode exists and ignore the ResponseCode not equal to 0 filter, This column i have to create into this visualization only.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.