# Apply Label Template in URL format for field not null

**URL:** <https://discuss.elastic.co/t/apply-label-template-in-url-format-for-field-not-null/369783>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [October 30, 2024, 6:16am UTC](https://discuss.elastic.co/t/apply-label-template-in-url-format-for-field-not-null/369783 "2024-10-30T06:16:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trungyutu](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@trungyutu](https://discuss.elastic.co/u/trungyutu)\
**Post date:** [October 30, 2024, 6:16am UTC](https://discuss.elastic.co/t/apply-label-template-in-url-format-for-field-not-null/369783/1 "2024-10-30T06:16:10Z")

</div>

Hi,  
I have a field name Issue Link which contain either a url or empty.  
My url is quite long so i want to shorter it, i use Url format in data view and set custom label to "Bug".  
And the output in kibana:

 ![3](https://us1.discourse-cdn.com/elastic/original/3X/8/c/8cd361a91f01e6d274ca20b844663bfc5fc6b88f.png)  
It also apply to null value in Issue Link field but i want to apply label for only value is not null here, is there anyway to accomplish this.

---

<div class="post-metadata">

**Author:** ![thiagodsrodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiagodsrodrigues/32/133778_2.png) [@thiagodsrodrigues](https://discuss.elastic.co/u/thiagodsrodrigues)\
**Post date:** [October 30, 2024, 6:59am UTC](https://discuss.elastic.co/t/apply-label-template-in-url-format-for-field-not-null/369783/2 "2024-10-30T06:59:36Z")

</div>

To display a custom label in Kibana only when the `Issue Link` field has a URL (and leave it blank when empty), you can use a scripted field. This will allow the label to appear only in cases where the link is actually present.

---

<div class="post-metadata">

**Author:** ![trungyutu](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@trungyutu](https://discuss.elastic.co/u/trungyutu)\
**Post date:** [October 30, 2024, 7:17am UTC](https://discuss.elastic.co/t/apply-label-template-in-url-format-for-field-not-null/369783/3 "2024-10-30T07:17:35Z")

</div>

Hi Thiago,  
Thanks for the solution, but when i apply your script, it is shown as image below, the scripted field here is "test", is there something that i am missing.

 ![4](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f24d6d3f09c7d29f537dc8ffc53facd5e715f964.png)
