Yes, this error was resolved by elevating privileges of elastic.output user and specifying the kibana host.
Now the output of the setup command is not showing any errors. I ran it with the -e flag after specifying setup.ilm.overwrite: true in the metricbeat.yml file.
There is actually monitoring data showing up in Stack Monitoring of the new cluster. But it is not showing up in the Stack Monitoring of the monitoring cluster..
run metricbeat -c /full/path/metricbeat.yml -e -d "*"
My config is at /etc/metricbeat/metricbeat.yml
Here is a log related to connection
{"log.level":"info","@timestamp":"2024-02-21T13:25:43.402-0500","log.logger":"publisher_pipeline_output","log.origin":{"function":"github.com/elastic/beats/v7/libbeat/publisher/pipeline.(*netClientWorker).run","file.name":"pipeline/client_worker.go","file.line":145},"message":"Connection to backoff(elasticsearch(https://esmonitor1.mynetwork.com:9200)) established","service.name":"metricbeat","ecs.version":"1.6.0"}
/usr/bin/metricbeat test output
elasticsearch: https://esmonitor1.mynetwork.com:9200...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: **monitoring cluster's ip**
dial up... OK
TLS...
security: server's certificate chain verification is enabled
handshake... OK
TLS version: TLSv1.3
dial up... OK
talk to server... OK
version: 8.12.1
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.