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:
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:
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