# Kibana runtime URL field - Use different values for the url template e for the label template

**URL:** <https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206>\
**Category:** Kibana\
**Created:** [August 21, 2025, 12:48pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206 "2025-08-21T12:48:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigopaulodecastro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigopaulodecastro/32/142553_2.png) [@rodrigopaulodecastro](https://discuss.elastic.co/u/rodrigopaulodecastro)\
**Post date:** [August 21, 2025, 12:48pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/1 "2025-08-21T12:48:24Z")

</div>

I know this was limitation in the past, but still is?

Its odd to display the full URL as a field label, is there any way to acomplish a label different the URL?

Tks.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 21, 2025, 4:06pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/2 "2025-08-21T16:06:23Z")

</div>

Hi @rodrigopaulodecastro, Welcome to the community

If you would like help, we need a little (a lot 🙂 ) more detail  
Can you provide some additional details, such as:

- example documents
- what you are seeing
- what you want to see
- What Version of the Stack (Important)

---

<div class="post-metadata">

**Author:** ![rodrigopaulodecastro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigopaulodecastro/32/142553_2.png) [@rodrigopaulodecastro](https://discuss.elastic.co/u/rodrigopaulodecastro)\
**Post date:** [August 21, 2025, 5:01pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/3 "2025-08-21T17:01:34Z")

</div>

Alright, so I have an idex of gitlab repository files, I would like to have a runtime field type URL for the file name with a link to it on gitlab.

I currently have this script to set the URL value:

```auto
def name_src = '';
if (doc['name.keyword'].size() > 0) {
    name_src = doc['name.keyword'].value.replace(' ', '');
} 
def project_src = '';
if (doc['project.keyword'].size() > 0) {
    project_src = doc['project.keyword'].value.replace(' ', '');
}
emit('gitlab/' + project_src + '/-/blob/master/' + name_src);

```

This is going to be the field URL value compossed by the project e file name, but I need to use just the file name value on the field label.

Example:

URL template:  
{{rawValue}}

Label template:  
{{_doc['name.keyword'].value_}}

Tks

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 21, 2025, 5:46pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/4 "2025-08-21T17:46:47Z")

</div>

> [@rodrigopaulodecastro](#):
>
> Its odd to display the full URL as a field label,

Apologies I still do not understand what you mean by this... Field name should not be full URLs ... if that is the case where is that coming from, What is the source of this data

Please provide a source document(s) to test against with the different variations

With  
The Before Doc  
The Expected After Doc

---

<div class="post-metadata">

**Author:** ![rodrigopaulodecastro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigopaulodecastro/32/142553_2.png) [@rodrigopaulodecastro](https://discuss.elastic.co/u/rodrigopaulodecastro)\
**Post date:** [August 21, 2025, 6:40pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/5 "2025-08-21T18:40:04Z")

</div>

I did not mention field name. name.keyword refers to gitlab file name and project.keyword refers to gitlab project name. These two informations compose the gitlab URL.

The question is, on the Kibana Discover search results, I want to have a link to the file but display only the file name to be clickable, not the full URL.

 ![discover](https://us1.discourse-cdn.com/elastic/original/3X/f/6/f6dd25e5c68b6abe1ae813905cac985edf40598e.jpeg)

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [August 22, 2025, 9:01am UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/6 "2025-08-22T09:01:35Z")

</div>

Hello @rodrigopaulodecastro

It seems as per the documentation what you are trying to achieve might not be possible.  
[Label template](https://www.elastic.co/docs/explore-analyze/find-and-organize/data-views#string-field-formatters)

_To pass unescaped values directly to the URL, use the {{rawValue}} string.  
A Label template enables you to specify a text string that appears instead of the raw URL. You can use the {{value}} template string normally in label templates. You can also use the {{url}} template string to display the formatted URL._

Useful link : [[Url field formatter] The url template doesn't work as expected · Issue #152542 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/152542)

If you had to substitute only 1 value while forming the URL than i think it is possible :

```auto
https://www.google.com/?z&no_sw_cr=Eddie

```

 ![Screenshot 2025-08-22 103805](https://us1.discourse-cdn.com/elastic/original/3X/8/8/8852faa47b6fe74a1a478fd43ca734f1ecc6bf7e.png)

Thanks!!

---

<div class="post-metadata">

**Author:** ![rodrigopaulodecastro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigopaulodecastro/32/142553_2.png) [@rodrigopaulodecastro](https://discuss.elastic.co/u/rodrigopaulodecastro)\
**Post date:** [August 22, 2025, 12:03pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/7 "2025-08-22T12:03:28Z")

</div>

Thats exactly the problem, yes as per documentation it is not possible. I am giving up on this one. Tks.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 22, 2025, 1:35pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/8 "2025-08-22T13:35:26Z")

</div>

Hi @rodrigopaulodecastro

Yes I am afraid you and @Tortoise are correct I tried all my tricks... but yes seem like this is a limitation. Sorry I worked on this last night but fell asleep before I answered 🙂

I tried all sorts of things I was hoping I could use a value from another field but alas not the case...

---

<div class="post-metadata">

**Author:** ![rodrigopaulodecastro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigopaulodecastro/32/142553_2.png) [@rodrigopaulodecastro](https://discuss.elastic.co/u/rodrigopaulodecastro)\
**Post date:** [August 22, 2025, 4:54pm UTC](https://discuss.elastic.co/t/kibana-runtime-url-field-use-different-values-for-the-url-template-e-for-the-label-template/381206/9 "2025-08-22T16:54:53Z")

</div>

Much apreciated, thank you.
