How i could do this?


(iker ena) #1

hello,
i have a table in a database with information about infections in all the hosts of this network, and i have another table with the inventory.
i wanna have the average of each (infected host of one type)/(total host of one type), for example, the infected windows 7 host/the total of windows 7 host.
How i can do that?. and do a graphic with that?
Thanks.


(Tim Sullivan) #2

Kibana would need to support pipeline aggregations for this to be possible, which it does not right now as part of its core.

You could add a field to each document that has that divide calculation, and make any kind of visualization based on that field.


(iker ena) #3

thanks, and how i could divide two terms, for example infections on windows 7 hosts/number of hosts with windows 7?


(Tim Sullivan) #4

If your data is time-based and you want a line chart with a moving ratio, then using the Timelion plugin for Kibana could be what you're looking for.

Otherwise, you can achieve this with a custom aggregation using a scripted metric aggregation: https://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-aggregations-metrics-scripted-metric-aggregation.html Note that you can't run this kind of aggregation from within Kibana, but you can take the output of that aggregation and write a program that creates a new index with the pre-comuted output data which will make it viewable from Kibana.


(system) #5