Open gitpel opened 2 years ago
update:
The same behaviour with metricbeat kibana module api_key
results HTTP error 401 in : 401 Unauthorized
, but works fine with username\password, the same api_key
from the same user works fine with output.elasticsearch.api_key
Pinging @elastic/stack-monitoring (Stack monitoring)
Pinging @elastic/integrations (Team:Integrations)
Hi! We just realized that we haven't looked into this issue in a while. We're sorry!
We're labeling this issue as Stale
to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1
.
Thank you for your contribution!
Since the modules support these standard http config options, we can use a header to pass the base64 ApiKey
- module: elasticsearch
xpack.enabled: true
period: 10s
hosts: ["https://my-elasticsearch.url:9200"]
headers:
Authorization: ApiKey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==
Or if they ApiKey is in the keystore...
- module: elasticsearch
xpack.enabled: true
period: 10s
hosts: ["https://my-elasticsearch.url:9200"]
headers:
Authorization: ApiKey ${api_key}
Metricbeat doesn't work properly with
api_key
in metricbeat elasticsearch module but work ok withusername\password
the sameapi_key
works fine in theoutput.elasticsearch.api_key
/etc/metricbeat/modules.d/elasticsearch-xpack.yml
! note that the same
api_key
works fine in/etc/metricbeat/metricbeat.yml
error log:
metricbeat/stable,now 7.15.2 amd64 [installed]
Debian GNU/Linux 11 (bullseye)
solution: use username\password instead of api_key in
/etc/metricbeat/modules.d/elasticsearch-xpack.yml