So I have an index with ping data from host A to host B and my data looks like this:
{
"@version" => "1",
"@timestamp" => "2014-07-17T21:17:34.030Z",
"host" => "host_a",
"to_host" => "host_b",
"value" => "25.6",
"from_host" => "host_a",
"stat_type" => "ping"
}
The goal is to also store 90th percentile data for the value of the ping ("value" in the above) on a moving window e.g. last hour, last day etc.
I know I can do this with an aggregation but my question is as follows:
Does ElasticSearch support a way to automatically add the output of an aggregation (or query for that matter) back into the index?
I know I could probably just take the output, tweak the fields and then put the data back in using some helper application but was curious as to if this is possible only using ES.
To use an equivalent SQL example, I would be looking for something like this:
create table agg
select id, count(*) as counts
from data
group by id;