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