# Using app.kubernetes.io/name label

**URL:** <https://discuss.elastic.co/t/using-app-kubernetes-io-name-label/312088>\
**Category:** Logstash\
**Created:** [August 15, 2022, 11:04am UTC](https://discuss.elastic.co/t/using-app-kubernetes-io-name-label/312088 "2022-08-15T11:04:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AssafKatz3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/assafkatz3/32/109653_2.png) [@AssafKatz3](https://discuss.elastic.co/u/AssafKatz3)\
**Post date:** [August 15, 2022, 11:04am UTC](https://discuss.elastic.co/t/using-app-kubernetes-io-name-label/312088/1 "2022-08-15T11:04:46Z")

</div>

Hi,  
I am trying to define service as the content of [app.kubernetes.io/name](http://app.kubernetes.io/name) label if it empty by:

```auto
    if ![service] and [kubernetes][labels][app_kubernetes_io/name] {
        mutate {
            add_field => { "service" => '[kubernetes][labels][app_kubernetes_io/name]'}
        }
    } 

```

And a lot of variants of it (e.g. "%{[kubernetes][labels][app\_kubernetes\_io/name]"}) but failed (with above, I got the text instead the value).  
I am using Logstash 7.16.3.  
Thanks

---

<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:** [September 12, 2022, 11:05am UTC](https://discuss.elastic.co/t/using-app-kubernetes-io-name-label/312088/2 "2022-09-12T11:05:21Z")

</div>

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