How to get SUM of each category


(Atanu Panda) #1

"extras":{"responseTime":"123", "transaction_type";"abc"}
"extras":{"responseTime":"22", "transaction_type";"abc"}
"extras":{"responseTime":"456", "transaction_type";"abc"}
"extras":{"responseTime":"12", "transaction_type";"xyz"}
"extras":{"responseTime":"45", "transaction_type";"xyz"}

Need bar chart with X-axis as transaction_type (abc , xyz)
and Y-axis as Total response time for each transaction_type {xyz = (12+45), abc=(123+22+456)}

Please suggest. or send some tutorial


(Thomas Neirynck) #2

In the Bar-chart visualization page:

  • use the "Sum"-metric in the Data-panel. It's in the drop downs. Select "responseTime" as the field you will sum.
  • Your Y-axis would be a "Terms"-aggregation with "transaction_type" as the field.

(Atanu Panda) #3

Thanks for ur immediate reply.

Actually, i could not see these fields in the drop down, one of the reason might be these are not shown as indexed in the discover page. Not sure how we can index these fields.

Is it the values are of different type for the field across logs (for a given period of time).

Please suggest..


(Magnus Bäck) #4

Make sure your responseTime field is an integer. String fields can't be summed.


(Atanu Panda) #5

Thanks for ur reply.

if i make it to Long, is there any problem...
Also i could see one field in the drop down as extras.responseTime ...from where it is coming, is it any in-build field.


(Magnus Bäck) #6

if i make it to Long, is there any problem...

Long is an integer type so it'll work fine.

Also i could see one field in the drop down as extras.responseTime ...from where it is coming, is it any in-build field.

No, that's not a built-in field.


(Atanu Panda) #7

Thanks for ur reply


(system) #8

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