I've enabled the X-Pack on Elasticsearch Module in Metricbeat 7.4.1. I have SSL set up for my Elasticsearch cluster (single node, Kibana, Losgstash, and other beats are fine) and am attempting to get Metricbeat to query Elasticsearch, but it is not parsing the "hosts:" field properly.
Logs state the following:
- As expected a "hosts:" of "http://localhost:9200", Metricbeat attempts to contact http://localhost:9200
- hosts: "http://elasticsearch.domain.local:9200" -> http://elasticsearch.domain.local:9200
- But, hosts: "https://localhost:9200" -> http://localhost:9200
- and, hosts: "https://elasticsearch.domain.local:9200" -> http://localhost:9200
I've tried a bunch of other combos, but ivariably when I attempt https over port 9200, Metricbeat will attempt to connect to Elasticsearch on http://localhost:9200. To me, this does not jive with what their documentation says I should be able to do.
Is there an error in my config or is there something that Metricbeat is messing up?
Elasticsearch Config:
cluster.routing.allocation.enable: all
node.name: hp-elastic
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.supported_protocols: TLSv1.3, TLSv1.2, TLSv1.1
xpack.security.http.ssl.key: /etc/elasticsearch/secure/elasticsearch.key
xpack.security.http.ssl.certificate: /etc/elasticsearch/secure/elasticsearch.crt
xpack.security.http.ssl.certificate_authorities: /etc/elasticsearch/secure/bengel+CA.crt
discovery.type: single-node
xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.collection.enabled: true
Metricbeat Config:
metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: true
reload.period: 10s
metricbeat.modules:
- module: system
metricsets:
- cpu # CPU usage
- load # CPU load averages
- memory # Memory usage
- network # Network IO
- process # Per process metrics
- process_summary # Process summary
- uptime # System Uptime
- socket_summary # Socket summary
- core # Per CPU core usage
- diskio # Disk IO
- filesystem # File system usage for each mountpoint
- fsstat # File system summary metrics
enabled: true
period: 30s
processes: ['.*']
cpu.metrics: ["percentages"]
core.metrics: ["percentages"]
socket.reverse_lookup.enabled: true
socket.reverse_lookup.success_ttl: 60s
socket.reverse_lookup.failure_ttl: 120s
- module: elasticsearch
metricsets:
- ccr
- cluster_stats
- index
- index_recovery
- index_summary
- ml_job
- node_stats
- shard
period: 10s
hosts: ["https://elasticsearch.domain.local:9200"]
xpack.enabled: true
setup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
setup.dashboards.enabled: true
setup.kibana:
host: "https://kibana.domain.local:5601"
output.logstash:
hosts: ["logstash.bengel.local:5044"]
ssl.certificate_autorities: ["/etc/ssl/certs/ca-bundle.crt"]
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
Log Output
No errors until:
2019-10-30T11:08:22.569-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.ccr: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.570-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.ml_job: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.571-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.index_summary: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.571-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.index_recovery: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.571-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.cluster_stats: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.576-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.node_stats: error making http request: Get http://localhost:9200/_nodes/_local/stats: EOF 2019-10-30T11:08:22.579-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.shard: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF 2019-10-30T11:08:22.579-0400 INFO module/wrapper.go:252 Error fetching data for metricset elasticsearch.index: error determining if connected Elasticsearch node is master: error making http request: Get http://localhost:9200/_nodes/_local/nodes: EOF