Is it possible to apply aggrigate function on scripted fields in kibana? e-g Sum of product


(Rizwan) #1

I want to do this and generate a scripted field

SUM(doc['Field1'].value) /SUM( doc['Field2'].value)

is this possible in Kibana or any work around for this ?


(Khalah Jones Golden) #2

Hey mrizwan,

Sorry but I'm pretty sure it is not possible to do as you describe here. Scripted fields are applied after the aggregation. maybe you could apply the sum beforehand, though I need to do more research as to how you might go about that.


(Tanya Bragin) #3

Khalah's right - this is not possible with Kibana scripted fields. However, if you install the Timelion plugin, its query language will allow stuff like that: https://www.elastic.co/blog/timelion-timeline


(system) #4