# Coding a Loki derived field of type Internal Link in the datasources.yaml file

**URL:** <https://community.grafana.com/t/coding-a-loki-derived-field-of-type-internal-link-in-the-datasources-yaml-file/33383>\
**Category:** Grafana Loki\
**Tags:** loki\
**Created:** [July 9, 2020, 9:49am UTC](https://community.grafana.com/t/coding-a-loki-derived-field-of-type-internal-link-in-the-datasources-yaml-file/33383 "2020-07-09T09:49:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![senthilcool](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@senthilcool](https://community.grafana.com/u/senthilcool)\
**Post date:** [July 9, 2020, 9:49am UTC](https://community.grafana.com/t/coding-a-loki-derived-field-of-type-internal-link-in-the-datasources-yaml-file/33383/1 "2020-07-09T09:49:05Z")

</div>

I have a docker compose file with application containers and one container each for Prometheus, Loki, Zipkin and Grafana.

I am trying to code a derived field of type Internal Link in the datasources.yaml file mounted in the Grafana container. But the below snippet doesn’t seem to work. The Grafana UI does not show this derived field as an internal link (internal link toggle is disabled).

```auto
apiVersion: 1

datasources:

  - name: Zipkin
    type: zipkin
    access: proxy
    url: http://zipkin:9411
    editable: true
    
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    editable: true

  - name: Loki
    type: loki
    access: proxy
    url: http://loki:3100
    editable: true
    isDefault: true
    jsonData:
      derivedFields:
        - datasourceName: Zipkin
          matcherRegex: "\\[.*,(\\w+),.*,.*\\]"
          name: TraceID
          url: "${__value.raw}"

```

[https://grafana.com/docs/grafana/latest/features/datasources/loki/](https://grafana.com/docs/grafana/latest/features/datasources/loki/) has an example snippet, but that uses “datasourceUid”. I doubt that the datasourceUid is available during design time.

What am I missing?

Also, I am able to get the internal link working using the Grafana UI. Is there a way to export the datasources.yaml from a running Grafana instance?

Thanks for your help.

cheers,  
senthil

---

<div class="post-metadata">

**Author:** ![ivanahuckova](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/ivanahuckova/32/8541_2.png) [@ivanahuckova](https://community.grafana.com/u/ivanahuckova)\
**Post date:** [July 9, 2020, 2:03pm UTC](https://community.grafana.com/t/coding-a-loki-derived-field-of-type-internal-link-in-the-datasources-yaml-file/33383/2 "2020-07-09T14:03:38Z")

</div>

Hello @senthilcool! 👋 Please, check out this github issue to see more information/guidance on how to set this up:

> <https://github.com/grafana/grafana/issues/26087>
>
> \#23585
> What happened:
> I have configuration with multiple datasources. I configured Loki with derived field, but only option how to link Jaeger internally...

---

<div class="post-metadata">

**Author:** ![senthilcool](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@senthilcool](https://community.grafana.com/u/senthilcool)\
**Post date:** [July 9, 2020, 3:59pm UTC](https://community.grafana.com/t/coding-a-loki-derived-field-of-type-internal-link-in-the-datasources-yaml-file/33383/3 "2020-07-09T15:59:02Z")

</div>

Hi @ivanahuckova, 👌. 🙏
