prometheus-community / elasticsearch_exporter

Elasticsearch stats exporter for Prometheus
Apache License 2.0
1.93k stars 790 forks source link

Fail to retrieve data from ELK 8.1.1,Is it possible that this version does not support Elasticsearch versions 8.X? #895

Open TYQ33 opened 5 months ago

TYQ33 commented 5 months ago

Eg:dial tcp: lookup user on [::1]:53: read udp [::1]:11958->[::1]:53: read: connection refused"

config: ExecStart=/data/es_exporter/elasticsearch_exporter-1.7.0/elasticsearch_exporter \ --es.all \ --es.indices \ --es.shards \ --es.aliases \ --es.indices_settings \ --collector.clustersettings \ --es.indices_mappings \ --es.data_stream \ --es.timeout=10s \ --web.listen-address=x.x.x.x:9114 \ --es.uri http://user:password@x.x.x.x:9200 Q2:How should the password be written if it contains the "#" or "@" character? Thanks!

archana-punia commented 5 months ago

did you got it working for Elastic 8.X? I am also facing same issues.

TYQ33 commented 5 months ago

did you got it working for Elastic 8.X? I am also facing same issues.

No, I haven't resolved it yet either. I'm also seeking guidance to solve this issue.

sysadmind commented 5 months ago

I am not aware of any incompatibilities with 8.x as of this time. If you're having issues with the terminal and special characters in a password, single quote the entire es.uri value.

TYQ33 commented 5 months ago

I am not aware of any incompatibilities with 8.x as of this time. If you're having issues with the terminal and special characters in a password, single quote the entire es.uri value.

For example, if the password is '#H755d8@chi7gf', it would be written like this: --es.uri 'http://user:#H755d8@chi7gf@x.x.x.x:9200' Or --es.uri 'http://user:%23H755d8%40chi7gf@x.x.x.x:9200' Which one is correct? Thanks!

sysadmind commented 5 months ago

I am not aware of any incompatibilities with 8.x as of this time. If you're having issues with the terminal and special characters in a password, single quote the entire es.uri value.

For example, if the password is '#H755d8@chi7gf', it would be written like this: --es.uri 'http://user:#H755d8@chi7gf@x.x.x.x:9200' Or --es.uri 'http://user:%23H755d8%40chi7gf@x.x.x.x:9200' Which one is correct? Thanks!

It would be the first one. The go library should handle the encoding automatically.

TYQ33 commented 3 months ago

--es.uri '[http://user:#H755d8@chi7gf@x.x.x.x:9200]'
This is incorrect."How should it be written correctly?"

sysadmind commented 1 month ago

I was incorrect. If the password has special characters, they must be URL escaped before putting them into the es.uri argument.