# Docker Plugin - Logging Driver - Loki

**URL:** <https://discuss.hashicorp.com/t/docker-plugin-logging-driver-loki/28252>\
**Category:** Nomad\
**Created:** [August 15, 2021, 4:44pm UTC](https://discuss.hashicorp.com/t/docker-plugin-logging-driver-loki/28252 "2021-08-15T16:44:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrlaberge](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@jrlaberge](https://discuss.hashicorp.com/u/jrlaberge)\
**Post date:** [August 15, 2021, 4:44pm UTC](https://discuss.hashicorp.com/t/docker-plugin-logging-driver-loki/28252/1 "2021-08-15T16:44:01Z")

</div>

Hi, I am new to Nomad and trying to configure the logging driver to be Loki for all running docker jobs.

I am trying to pass the extra\_labels to Loki via configuring it as such:

```auto
 logging {
       type = "loki"
       config {
         loki-url = "http://my_ip:3100/loki/api/v1/push"
         loki-external-labels = "job={{ .Label `com.hashicorp.nomad.job_name` }},task_name={{ .Label `com.hashicorp.nomad.task_name` }}, container_name="
       }
     }

```

But it returns an error:

```auto
API error (500): failed to initialize logging driver: error creating logger: error creating loki logger: loki: could not expand label value: {{ .Label `com.hashicorp.nomad.job_name` }} err : template: label_value:1:3: executing "label_value" at <.Label>: can't evaluate field Label in type *logger.Info

```

---

<div class="post-metadata">

**Author:** ![lgfa29](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/lgfa29/32/2386_2.png) [@lgfa29](https://discuss.hashicorp.com/u/lgfa29)\
**Post date:** [August 17, 2021, 3:31pm UTC](https://discuss.hashicorp.com/t/docker-plugin-logging-driver-loki/28252/2 "2021-08-17T15:31:39Z")

</div>

Hi @jrlaberge 👋

I don’t have a lot of experience with Loki, but from their [docs](https://grafana.com/docs/loki/latest/clients/docker-driver/configuration/#labels) it doesn’t seem like it can read container labels?

Take a look at this blog post from the community [Logging on Nomad and log aggregation with Loki :: Adrian Todorov](https://atodorov.me/2021/07/09/logging-on-nomad-and-log-aggregation-with-loki/), maybe there’s something there that can help you.
