Hi there
Is it possible to choose date_histogram aggregation interval by signal?
I have data:
"name": "funkce",
"url": {
"index": "t-function-*",
"body": {
"_source": ["@timestamp", "metricset.name", "generalDetails.login", "generalDetails.dbName", "generalDetails.dbServer"],
"size": 10000,
"query": {
"bool": {
"must": [
{"range": {"@timestamp": {"from": {"%timefilter%": "min"}, "to": {"%timefilter%": "max"}}}},
{"match": {"metricset.name": "Run"}}
]
}
},
"aggs": {
"table": {
"composite": {
"size": 10000,
"sources": [
{"time": {"date_histogram": {"field": "@timestamp", "interval": "day", "time_zone": "Europe/Prague"}}},
{"label": {"terms": {"field": "generalDetails.dbServer.keyword"}}},
{"label2": {"terms": {"field": "generalDetails.dbName.keyword"}}},
{"label3": {"terms": {"field": "generalDetails.login.keyword"}}}
]
}
}
}
}
},
"format": {"property": "aggregations.table.buckets"},
But I would like to choose "interval" between "day" or "hour" based on signal input.
I don't want to duplicate data because of performace.
All your ideas are welcome
Misa