# Adding K8s labels to log lines

**URL:** <https://community.dynatrace.com/t/adding-k8s-labels-to-log-lines/43301>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [December 20, 2023, 6:57am UTC](https://community.dynatrace.com/t/adding-k8s-labels-to-log-lines/43301 "2023-12-20T06:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [December 20, 2023, 6:57am UTC](https://community.dynatrace.com/t/adding-k8s-labels-to-log-lines/43301/1 "2023-12-20T06:57:53Z")

</div>

Hi All,

We have a use case in which we want to add the value of a specific k8s workload label to the log lines of the relevant pods. My questions is actually very simple: on which grail “table” is it stored?

Gil.

---

<div class="post-metadata">

**Author:** ![LawrenceBarratt](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/lawrencebarratt/32/26634_2.png) [@LawrenceBarratt](https://community.dynatrace.com/u/LawrenceBarratt)\
**Post date:** [December 20, 2023, 11:46am UTC](https://community.dynatrace.com/t/adding-k8s-labels-to-log-lines/43301/2 "2023-12-20T11:46:40Z")

</div>

Hi&nbsp;[@gilgi](https://community.dynatrace.com/user/12008)

The Workloads are within _dt.entity.cloud\_application_, and pods are stored in _dt.entity.cloud\_application\_instance_

Reflecting part of the URL when you’re in a workload and a pod.

This DQL I am looking for a specific label from the Workload “control-plane”

```markup
fetch dt.entity.cloud_application_instance
|fields entity.name,id,workloadName
| lookup sourceField:workloadName, lookupField:entity.name, [fetch dt.entity.cloud_application
| expand cloudApplicationLabels[`control-plane`], alias:controlPlane]
| filter isNotNull(lookup.controlPlane)

```

Thanks,

Lawrence
