# Filter by Date in URL

**URL:** <https://discuss.elastic.co/t/filter-by-date-in-url/337083>\
**Category:** Kibana\
**Created:** [June 28, 2023, 12:57pm UTC](https://discuss.elastic.co/t/filter-by-date-in-url/337083 "2023-06-28T12:57:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lehmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lehmer/32/122807_2.png) [@Lehmer](https://discuss.elastic.co/u/Lehmer)\
**Post date:** [June 28, 2023, 12:57pm UTC](https://discuss.elastic.co/t/filter-by-date-in-url/337083/1 "2023-06-28T12:57:09Z")

</div>

Hi,

I need to access a kibana web filtering by date, but I need to put the filter in the URL.  
I know how to filter Namespaces and Jobs with the URL using queries:

> https:// kibana-host/s/desa/app/dashboards#/view/9908d490-c3f5-11ed-8c84-e52f5b4f9c1f?\_a=(filters:!((query:(match\_phrase:(kubernetes.labels.task-name:_[job\_name]_))),(query:(match\_phrase:(kubernetes.namespace:_[namespace\_name]_)))))

But in the query of Date there are some characters like @ : - + . that you must use in the query, but are not accepted in the URL.

```auto
{
  "query": {
    "range": {
      "@timestamp": {
        "lt": "2017-10-24T09:06:24.075+02:00",
        "gte": "2017-10-24T09:01:24.075+02:00"
      }
    }
  }
}

```

How can I implement this filter inside the URL??

Thanks a lot

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [July 7, 2023, 7:40pm UTC](https://discuss.elastic.co/t/filter-by-date-in-url/337083/2 "2023-07-07T19:40:13Z")

</div>

Hi @Lehmer. The query needs to be encoded in [RISON](https://rison.dev/) in the URL.

Since I don't want to try to encode it myself, I just added a filter to the dashboard with your query DSL. Then I clicked the "Share" button and chose "Get links" and "Generate link as a snapshot" and "Copy link". This copied the encoded URL to my clipboard.

Hope that helps.

![Jul-07-2023 15-39-01](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4da079eab1207cde389cf0bde1ada2672ae95e1e.gif)

---

<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 4, 2023, 7:40pm UTC](https://discuss.elastic.co/t/filter-by-date-in-url/337083/3 "2023-08-04T19:40:25Z")

</div>

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