# Co.elastic.metrics/raw to "simpler" format

**URL:** <https://discuss.elastic.co/t/co-elastic-metrics-raw-to-simpler-format/321009>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 12, 2022, 8:49am UTC](https://discuss.elastic.co/t/co-elastic-metrics-raw-to-simpler-format/321009 "2022-12-12T08:49:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![firecow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/firecow/32/114549_2.png) [@firecow](https://discuss.elastic.co/u/firecow)\
**Post date:** [December 12, 2022, 8:49am UTC](https://discuss.elastic.co/t/co-elastic-metrics-raw-to-simpler-format/321009/1 "2022-12-12T08:49:34Z")

</div>

Hey guys, i'm trying to convert this to a more "simpler" version for better Yaml anchoring reusage.

```nohighlight
co.elastic.metrics/raw: >-
    [
      {
        "enabled": "true",
        "module": "http",
        "metricsets": [
          "json"
        ],
        "headers": {"remote-user": "metricbeat"},
        "hosts": ["$${data.host}:80"],
        "path": "/metrics?format=json",
        "method": "GET",
        "period": "10s",
        "namespace": "myproduct"
      }
    ]

```

This is what I've got so far, but the remote-user header isn't sent to my service

```nohighlight
co.elastic.metrics/hosts: "$${data.host}:80"
co.elastic.metrics/module: http
co.elastic.metrics/metricsets: json
co.elastic.metrics/headers.remote-user: "metricbeat"
co.elastic.metrics/path: "/metrics?format=json"
co.elastic.metrics/method: "GET"
co.elastic.metrics/period: "10s"
co.elastic.metrics/namespace: "myproduct"

```

I'm pretty sure that it's only the headers section that isn't working, since there are logged.

```auto
Authentication by remote-user header could not be validated

```

What is the proper way to specify headers in metrics labels/annotations?

---

<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:** [January 9, 2023, 10:49am UTC](https://discuss.elastic.co/t/co-elastic-metrics-raw-to-simpler-format/321009/2 "2023-01-09T10:49:35Z")

</div>

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