Vega date_histogram aggregation interval based on signal

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

No, this is not supported due to the way Vega is connected to Elasticsearch. Documentation here: https://www.elastic.co/guide/en/kibana/7.9/vega-reference.html#vega-queries

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.