Filter by Date in URL

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.

{
  "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

Hi @Lehmer. The query needs to be encoded in RISON 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

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