# Vega date\_histogram aggregation interval based on signal

**URL:** <https://discuss.elastic.co/t/vega-date-histogram-aggregation-interval-based-on-signal/242149>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [July 22, 2020, 8:13am UTC](https://discuss.elastic.co/t/vega-date-histogram-aggregation-interval-based-on-signal/242149 "2020-07-22T08:13:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michaela\_Krkosova](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaela_krkosova/32/46926_2.png) [@Michaela\_Krkosova](https://discuss.elastic.co/u/Michaela_Krkosova)\
**Post date:** [July 22, 2020, 8:13am UTC](https://discuss.elastic.co/t/vega-date-histogram-aggregation-interval-based-on-signal/242149/1 "2020-07-22T08:13:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [July 22, 2020, 2:39pm UTC](https://discuss.elastic.co/t/vega-date-histogram-aggregation-interval-based-on-signal/242149/2 "2020-07-22T14:39:03Z")

</div>

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](https://www.elastic.co/guide/en/kibana/7.9/vega-reference.html#vega-queries)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 19, 2020, 2:39pm UTC](https://discuss.elastic.co/t/vega-date-histogram-aggregation-interval-based-on-signal/242149/3 "2020-08-19T14:39:08Z")

</div>

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