Add two fields in kibana within same Index

I get the multiple records from different nodes as follows:-1:
{"name":"AAA","price":"100"}
{"name":"BBB","price":"200"}
{"name":"CCC","price":"400"}
{"name":"AAA","price":"100"}
I want to add the price of all 3 reading and show the total price in graph. Is this possible in Kibana?

I think you can do this with a "top hit" aggregation with a split series on name.


It will only pick a single "top hit" (which I think is "most recent", not "highest". I could be wrong on that but as long as you expect duplicate names to have the same price, it doesn't matter).

Here's my sample data I used that matches what you gave:

Hope this helps!

You can achieve the same by creating a scripted field. Check for the detailed document here Scripted Field Document

This helped. Thanks! Can I calculate how long(time) the AAA was 100 or 0, BBB was 200, CCC was 400? I want to calculate the price distribution in last 24 hours, 1 week, 1month.

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