Basic math on numbers in elastic search


(Eric Odell) #1

Would like to do simple math on aggregations of documents, eg collectd disk plugin has free and used integer values and would like to calculate:

% disk free: free/(used+free)
derivitive of disk usage to predict when a disk will run out of space: -(free)/d(free)/dt

similarly interface plugin in collectd is a total of bytes tx and rx and need to calculate derivative of rx and tx to see bytes/time

This is easy to do in graphite which has many useful functions, eg "most deviant" which pulls out the top 5 metrics based on standard deviation.
would rather have everything in elastic than to split numeric time series into graphite


(Tanya Bragin) #2

Have you tried using an experimental Kibana plugin called Timelion? It was developed to deal with exactly this kind of time-series oriented operations on metric data: https://www.elastic.co/blog/timelion-timeline


(pitt) #3

Hi Tanya,

I need to predict data points for 3 next month, I use this command:
.es(index_stoz_baie_srdfbusy_histo, timefield=@timestamp),.es(metric='avg:BUSY').lines().label(BUSY).movingaverage(1)

In the help command, it show that .movingaverage need 2 arguments : window=number, position=string|null.
position=right, center, or left.
But, how I can predict data for the next 3 months ? I don't understand...

Regards.


(system) #4