# How can I represent a config key containing a dot/period/full-stop "."?

**URL:** <https://discuss.elastic.co/t/how-can-i-represent-a-config-key-containing-a-dot-period-full-stop/301907>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 8, 2022, 12:56am UTC](https://discuss.elastic.co/t/how-can-i-represent-a-config-key-containing-a-dot-period-full-stop/301907 "2022-04-08T00:56:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javabrett](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javabrett/32/104135_2.png) [@javabrett](https://discuss.elastic.co/u/javabrett)\
**Post date:** [April 8, 2022, 12:56am UTC](https://discuss.elastic.co/t/how-can-i-represent-a-config-key-containing-a-dot-period-full-stop/301907/1 "2022-04-08T00:56:53Z")

</div>

TL;DR: Can beats/metricsbeat/prometheus module tolerate a config key that contains dots/periods/full-stops, given the Beats go-ucfg config-processsing.

I am using `metricbeat` and module `prometheus`. For the Prometheus scrape `GET`, I need to include a queryString that includes dots in the parameter names. So an example config might be:

```auto
- module: prometheus
  period: 60s
  hosts: ["https://endpoint.with.https:443"]
  metricsets: ["query"]
  queries:
  - name: export
    path: /path/to/export
    params:
      foo.bar: baz
  username: "someuser"
  password: "somesecretpassword"

```

This results in a `GET` request to the metrics endpoint of: `https://endpoint.with.https:443/path/to/export?foo=map%5Bbar%3Abaz%5D` . Which is, decoded, a queryString of `foo=map[bar:baz]`, a mixed-up interpretation splitting the key into a key plus the start of a map.

I've made a bunch of attempts to fix this, including various quoting or escaping in the key, to no avail.

I assume that this relates to the way Beat's config module, which I believe is [GitHub - elastic/go-ucfg: Golang universal configuration](https://github.com/elastic/go-ucfg) works? I think it has special support for config paths, with the detault path-separator ".", set I think at [beats/config.go at e5bc6ea4ae514c2f9f68f733ceb427003da58363 · elastic/beats · GitHub](https://github.com/elastic/beats/blob/e5bc6ea4ae514c2f9f68f733ceb427003da58363/libbeat/common/config.go#L59) .

Is there a way of escaping this, so I can have beats config keys containing a "."?

Looks like I might be suffering an issue similar to that reported in [Beats configuration "dotted" keys issue · Issue #27079 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/27079) ?

Thanks for any tips or workarounds for this.

Brett

---

<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:** [May 6, 2022, 2:57am UTC](https://discuss.elastic.co/t/how-can-i-represent-a-config-key-containing-a-dot-period-full-stop/301907/2 "2022-05-06T02:57:37Z")

</div>

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