# queryFilter and timeFilter

**URL:** <https://discuss.elastic.co/t/queryfilter-and-timefilter/189170>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [July 5, 2019, 9:26pm UTC](https://discuss.elastic.co/t/queryfilter-and-timefilter/189170 "2019-07-05T21:26:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![astv](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@astv](https://discuss.elastic.co/u/astv)\
**Post date:** [July 5, 2019, 9:26pm UTC](https://discuss.elastic.co/t/queryfilter-and-timefilter/189170/1 "2019-07-05T21:26:42Z")

</div>

@nyuriks is it possible to access queryFilter and timeFilter inside a custom vega visualization?

Similar to kibanaAddFilter method that allows for adding contextual filter to visualization or dashboards in vega?

I'd like to create a vega visualization where I can access these filters and use them to construct a mark with an href URL navigate to a custom search application and send the visualization or dashboard filters.

I saw these properties available in the Vega code, and thought it might be possible [https://github.com/elastic/kibana/blob/089e7c87b1abb2e6715cb8f6de8e1b451cde5b15/src/legacy/core\_plugins/vega/public/vega\_visualization.js](https://github.com/elastic/kibana/blob/089e7c87b1abb2e6715cb8f6de8e1b451cde5b15/src/legacy/core_plugins/vega/public/vega_visualization.js)

```
    const vegaViewParams = {
      vegaConfig,
      parentEl: this._el,
      vegaParser,
      serviceSettings,
      queryfilter: this._vis.API.queryFilter,
      timefilter: this._vis.API.timeFilter,
      findIndex: this.findIndex.bind(this),
      $rootScope,
    };

```

Thanks

Astrit

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [July 25, 2019, 3:20pm UTC](https://discuss.elastic.co/t/queryfilter-and-timefilter/189170/2 "2019-07-25T15:20:52Z")

</div>

Hi @astv right now is not possible to use directly the query filters and the time filters.  
The ES Query can be made aware of the surrounding context using the time filter and the query filter, but it's only applied to the `data.url` object via [https://github.com/elastic/kibana/blob/88fffd5f642cf7c34af6e1af4333e0de2e111c7d/src/legacy/core\_plugins/vis\_type\_vega/public/data\_model/es\_query\_parser.js#L39](https://github.com/elastic/kibana/blob/88fffd5f642cf7c34af6e1af4333e0de2e111c7d/src/legacy/core_plugins/vis_type_vega/public/data_model/es_query_parser.js#L39)

I think you can open an enhancement request ticket [here](https://github.com/elastic/kibana/issues/new?template=Feature_request.md) for that,

Thanks

---

<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 22, 2019, 3:21pm UTC](https://discuss.elastic.co/t/queryfilter-and-timefilter/189170/3 "2019-08-22T15:21:02Z")

</div>

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