# \[Metricbeat\]\[Elasticsearch module\] "basepath" configuration field is not working properly. Bug ?

**URL:** <https://discuss.elastic.co/t/metricbeat-elasticsearch-module-basepath-configuration-field-is-not-working-properly-bug/372776>\
**Category:** Beats\
**Tags:** beats-module, metricbeat\
**Created:** [January 3, 2025, 10:46pm UTC](https://discuss.elastic.co/t/metricbeat-elasticsearch-module-basepath-configuration-field-is-not-working-properly-bug/372776 "2025-01-03T22:46:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy\_f](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jeremy\_f](https://discuss.elastic.co/u/jeremy_f)\
**Post date:** [January 3, 2025, 10:46pm UTC](https://discuss.elastic.co/t/metricbeat-elasticsearch-module-basepath-configuration-field-is-not-working-properly-bug/372776/1 "2025-01-03T22:46:01Z")

</div>

Hello,

Scenario :

I try to retrieve metrics from an Elasticsearch service through an Nginx reverse proxy. Elasticsearch endpoint is https :// FQDN:443 /elasticsearch. Metricbeat version is 8.15.2

This is the reason why I need to use the "basepath" field, documented here : (...)

Config file :

```auto
- module: elasticsearch
  enabled: true
  metricsets:
    - node
    - node_stats
    - index
    - index_recovery
    - index_summary
    - ingest_pipeline
    - shard
  period: 10s
  hosts: ["https://FQDN:443"]
  basepath: "/elasticsearch"
  scope: cluster

```

Test module config (in failure, **excepted shard metrics** , run : metricbeat test modules -v)

```auto
elasticsearch...
  node...
    error... ERROR failed to get info from Elasticsearch: invalid character '<' looking for beginning of value
  node_stats...
    error... ERROR invalid character '<' looking for beginning of value
  index...
    error... ERROR failed to get info from Elasticsearch: invalid character '<' looking for beginning of value
  index_recovery...
    error... ERROR invalid character '<' looking for beginning of value
  index_summary...
    error... ERROR failed to get info from Elasticsearch: invalid character '<' looking for beginning of value
  ingest_pipeline...
    error... ERROR failed to get info from Elasticsearch: invalid character '<' looking for beginning of value
  shard...OK

```

On my Elasticseach in output, we saw issues in most of these URL, with basepath config missing. Consequence : metricbeat request a wrong service, retrieve an HTML page with "\<" character

 ![screenshot_bug_metricbeat-2](https://us1.discourse-cdn.com/elastic/original/3X/9/1/918895ebcf8b43cb971f4435ccb0219e3fba31f0.jpeg)

I tried to play with multiple configs, with no success. Is it a bug in metricbeat code ? I'm not a Go developer/expert, but you seems to have different parsing methods in metricsets files (please refer to Github Beats code)  
Thanks in advance for your help,
