I am currently using an Aggregation query to get Document Counts from a Date Histogram of 1 Minute samples. This is my current query:
scroll_query = {
"query" : {
"range": {
"Timestamp": {
"gte": "now-30d/d",
"lte": "now"
}
}
},
"size": 20,
"aggs" : {
"resample" : {
"date_histogram": {
"field": "Timestamp",
"interval": "minute"
}
}
}
}
And I am able to get Document Counts for each 1 minute time window:
{'resample': {'buckets': [{'key_as_string': '2019-09-20T11:30:00.0000000Z',
'key': 1568979000000,
'doc_count': 677},
{'key_as_string': '2019-09-20T11:31:00.0000000Z',
'key': 1568979060000,
'doc_count': 648},
{'key_as_string': '2019-09-20T11:32:00.0000000Z',
'key': 1568979120000,
'doc_count': 1873}
I am trying to convert this query into a "Rollup", where I just need document counts for bucketting done on Timestamp
.
I submitted this Rollup job:
rollup_payload = {
"index_pattern": "cn_index",
"rollup_index": "cn_rollup",
"cron": "*/30 * * * * ?",
"page_size" :1000,
"groups" : {
"date_histogram": {
"field": "Timestamp",
"interval": "minute"
}
}
}
When I run a query on this rollup, I get errors:
GET cn_rollup/_rollup_search
{
"size" : 0
}
I tried this query using different parameters, such as changing size
to 1000, but that throws a 400 Error. Is it possible to get the same results using Rollup?