Thanks again @stephenb
So I've used what was in my screenshot above (ie "top values") and when I inspect the graph, I see that the following request is made (I'm just showing the aggregations part):
"aggs": {
"0": {
"terms": {
"field": "distribution.instanceId",
"order": {
"0-orderAgg": "desc"
},
"size": 5,
"shard_size": 25
},
"aggs": {
"1": {
"date_histogram": {
"field": "date.current",
"calendar_interval": "1w",
"time_zone": "Europe/Paris",
"extended_bounds": {
"min": 1654095295706,
"max": 1730908914940
}
},
"aggs": {
"2": {
"max": {
"field": "users.total"
}
}
}
},
"0-orderAgg": {
"cardinality": {
"field": "distribution.instanceId"
}
}
}
}
That looks quite different from the agg I had posted above.
Full query:
URL: https://...domain.../activeinstalls2/installs3/_search?pretty Query:
{
"query": {
"bool": {
"must" : {
"query_string": {
"query": "distribution.extension.version:* AND -distribution.extension.version:*rc* AND -distribution.extension.version:*milestone* AND -distribution.instanceId:xxx"
}
},
"must_not": [
{
"bool": {
"filter": [
{
"wildcard": {
"distribution.extension.version": "*SNAPSHOT"
}
},
{
"wildcard": {
"distribution.extension.id": "*staging"
}
},
{
"wildcard": {
"distribution.extension.id": "*rc*"
}
}
]
}
}
],
"filter": [
{
"script" : {
"script" : "((doc['date.current'].value.toEpochSecond() - doc['date.first'].value.toEpochSecond()) >= 86400*5)"
}
},
{ "range": {
"date.current": {
"gte": "now-30d"
}
}
}]
}
},
"size": 0,
"fields": [
{
"field": "date.current",
"format": "date_time"
}],
"aggs": {
"by_day": {
"date_histogram": {
"field": "date.current",
"calendar_interval": "week",
"time_zone": "Europe/Paris"
},
"aggs": {
"instanceId_count": {
"cardinality": {
"field": "distribution.instanceId"
}
},
"max": {
"terms": {
"field": "distribution.instanceId",
"size": 2000
},
"aggs":{
"MAX_USERS":{
"max": {
"field": "users.total"
}
},
"MAX_DOCS":{
"max": {
"field": "documents.total"
}
},
"MAX_WIKIS":{
"max": {
"field": "wikis.total"
}
}
}
},
"sumusers":{
"sum_bucket": {
"buckets_path": "max>MAX_USERS"
}
},
"sumdocs":{
"sum_bucket": {
"buckets_path": "max>MAX_DOCS"
}
},
"sumwikis":{
"sum_bucket": {
"buckets_path": "max>MAX_WIKIS"
}
}
}
}
}
}
Results:
{
"took" : 315,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"by_day" : {
"buckets" : [
{
"key_as_string" : "2024-10-07T00:00:00.000+02:00",
"key" : 1728252000000,
"doc_count" : 22259,
"max" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 9843,
"buckets" : [
{
"key" : "...key1...",
"doc_count" : 639,
"MAX_USERS" : {
"value" : 1.0
},
"MAX_DOCS" : {
"value" : 1391.0
},
"MAX_WIKIS" : {
"value" : 1.0
}
},
{
"key" : "...key2...",
"doc_count" : 468,
"MAX_USERS" : {
"value" : 45.0
},
"MAX_DOCS" : {
"value" : 1015.0
},
"MAX_WIKIS" : {
"value" : 1.0
}
},
{
"key" : "...key3...",
"doc_count" : 109,
"MAX_USERS" : {
"value" : 145.0
},
"MAX_DOCS" : {
"value" : 3211.0
},
"MAX_WIKIS" : {
"value" : 1.0
}
},
...
FTR we've coded a visualization in XWiki, based on the agg above and the 2 graphs don't look similar for the same period:
In XWiki, based on the query just above:
In Kibana, based on the Lens you helped me with:
If I can't do it in Lens, do I need to use a different visualization? Like using Vega (which I'd need to learn ;))?
Thanks again