Visualization with Scripted Metric Aggregation


(Julian) #1

Hi everyone

Is there a way to create a visualization with the results of a scripted metric aggregation?.
My scripted aggregation executes a custom logic, then returns a hashmap of ('timestamp', 'value'), grouped by another normal aggregation (based on a field value, not scripted).

Something like this:

"Field 1" : {
"HashMap" : [
{"timestamp" , "value"},
{"timestamp" , "value"},
{"timestamp" , "value"},
...
]
},
"Field 2" : {
"HashMap" : [
{"timestamp" , "value"},
{"timestamp" , "value"},
{"timestamp" , "value"},
...
]
},
...

My goal is to visualize this as a bar chart, where the X-Axis would be 'timestamp' (as a histogram with an interval) and the 'Field' aggregation (as a split series), and the Y-Axis would be the sum of 'value'.

Thanks in advance.
Let me know if you have any questions.


(Chris Davies) #2

Hi Julian, I don't think you'll be able to get exactly what you want, but the closest thing to what you want it is the time series visual builder:

https://www.elastic.co/guide/en/kibana/current/time-series-visual-builder.html

With that, you could probably get pretty close by creating a table or a time series line chart.


(system) #3

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