Hi John,
You should be able to do something like:
{
"aggs": {
"verb": {
"terms": {
"field": "verb"
},
"aggs": {
"load_time_outliers": {
"percentiles": {
"field": "responsetime"
}
}
}
}
}
}
This will first break down your documents according to the http verb that
is being used and then compute percentiles separately for each unique verb.
On Fri, Aug 15, 2014 at 11:23 AM, John Ogden <[email protected]> wrote:
> Hi,
>
> Am trying to run a single command which calculates percentiles for
> multiple search queries.
> The data for this is an Apache log file, and I want to get the percentile
> response times for the gets, posts, heads (etc) in one go
>
> If I run this:
> curl -XPOST 'http://localhost:9200/_search?search_type=count&pretty=true'
> -d '{
> "facets": {
> "0": {"query" : {"term" : { "verb" : "get" }}},
> "1": {"query" : {"term" : { "verb" : "post" }}}
> },
> "aggs" : {"load_time_outlier" : {"percentiles" : {"field" :
> "responsetime"}}}
> }'
>
> The response I get back has the counts for each subquery but only does the
> aggregations for the overall dataset
> "facets" : {
> "0" : {
> "_type" : "query",
> "count" : 5678
> },
> "1" : {
> "_type" : "query",
> "count" : 1234
> }
> },
> "aggregations" : {
> "load_time_outlier" : {
> "values" : {
> "1.0" : 0.0,
> ...
> "99.0" : 1234
> }
> }
> }
>
> I cant figure out how to structure the request so that I get the
> percentiles separately for each of the queries
>
> Could someone point me in in the right direction please
>
> Many thanks
> John
>
> --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/9d9696cb-adfa-4812-bd81-5efee0d29032%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/9d9696cb-adfa-4812-bd81-5efee0d29032%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Adrien Grand
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5JwTLK2q10fEKX6bVBzYH69dSRgA2njoEvhhronqfh1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.