Calculate success count in Visualization using JSON Input

Hi All,

I am new to ELK stack, I want to implement a logic to find the count of daily success transactions on the basis of a field status(if status = "S" it is success).
I have implemented this logic by creating an scripted field (if status = S then set scripted field = 1) and then in the visualization , I have created a sum metric and I have got the count of daily success.

My question is, Is there a workaround to handle the complete logic in visualization rather than calculating at each field because calculating at field level may impact the performance?

Hello @rohitarora275

If I correctly understood, you want some directions on how to create a filtered visualization.

It is not necessary to define the scripted field for this kind of visualizations. Remove it.

In any visualization, you can use the count metric.
It will count the documents matching your filter, which you can add in the upper part of the dashboard.


Another approach is to split the series (the Buckets part) using the Filters:

Hi Luca_Belluccini,

Thanks for your reply, but here I have to display three values Success count, Total count and exception count.

With the help of your logic, I will be able to display only one count ,

Can you please help on this

You can use 3 Filters using the Filters sub aggregation: one for success one for exception and another for total.

1 Like

Thanks Luca_Belluccini, I am able to get three different count in three rows

@rohitarora275 glad it solved the issue!

Please mark the question as answered if possible.

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