# Issues with setting up urltemplate in Kibana

**URL:** https://discuss.elastic.co/t/issues-with-setting-up-urltemplate-in-kibana/355262
**Category:** Kibana
**Created:** [March 12, 2024, 9:37pm UTC](https://discuss.elastic.co/t/issues-with-setting-up-urltemplate-in-kibana/355262 "2024-03-12T21:37:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![b2ron](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@b2ron](https://discuss.elastic.co/u/b2ron)
#### Post date: [March 12, 2024, 9:37pm UTC](https://discuss.elastic.co/t/issues-with-setting-up-urltemplate-in-kibana/355262/1 "2024-03-12T21:37:28Z")

</div>

Question 1: How to use fields from the document in urltemplate instead of {{value}}?

While configuring urltemplate in Kibana, I've encountered an issue. I'm attempting to include another field from the document in the query besides {{value}}. I've tried various methods such as

```auto
/app/discover#/?_a=(index:'0c024ee0-8f2e-4b51-97d6-1774cb6ffdf5',interval:auto,query:(language:kuery,query:'http.request.id:%20{{value}}%20or%20service.name:%20{{service.name}}'))
/app/discover#/?_a=(index:'0c024ee0-8f2e-4b51-97d6-1774cb6ffdf5',interval:auto,query:(language:kuery,query:'http.request.id:%20{{value}}%20or%20service.name:%20{{doc[service.name]}}'))
/app/discover#/?_a=(index:'0c024ee0-8f2e-4b51-97d6-1774cb6ffdf5',interval:auto,query:(language:kuery,query:'http.request.id:%20{{value}}%20or%20service.name:%20{{ctx.service.name}}'))
/app/discover#/?_a=(index:'0c024ee0-8f2e-4b51-97d6-1774cb6ffdf5',interval:auto,query:(language:kuery,query:'http.request.id:%20{{value}}%20or%20service.name:%20{{context.service.name}}'))

```

but nothing seems to work. Is there a way to utilize other fields from the document in urltemplate, apart from {{value}}?

Question 2: How to pass a date range other than `_g=(time:(from:now-24h%2Fh,to:now))`?

During the setup of urltemplate in Kibana, I have a question regarding passing a date range. Currently, I'm passing it in the format of `_g=(time:(from:now-24h%2Fh,to:now))`, but I would like to know if there are other methods to pass a date range in urltemplate?

ps: elastic/kibana 8.12.0

---

<div class="post-metadata">

### Author: ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)
#### Post date: [March 13, 2024, 8:58am UTC](https://discuss.elastic.co/t/issues-with-setting-up-urltemplate-in-kibana/355262/2 "2024-03-13T08:58:31Z")

</div>

Hi @b2ron,

Current URL formatter supports only {{value}} or {{rawValue}} but it can't include other fields from the document. What can help to solve your case is to create a runtime field with a script which builds the required params list. And use this runtime field with a URL formatter.

Regarding the time range, you can set it in UI on a Discover page and then check how the current URL changes and copy that format.

---

<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: [April 10, 2024, 8:58am UTC](https://discuss.elastic.co/t/issues-with-setting-up-urltemplate-in-kibana/355262/3 "2024-04-10T08:58:32Z")

</div>

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