Hey, sorry for the delay.
Now when I curl -k -X GET https://hostname:9200
I receive:
{
"name": "heartbeats",
"cluster_name": "my-application",
"cluster_uuid": "mHkVAtwcSXWNHIL0Xm-zZQ",
"version": {
"number": "7.3.1",
"build_flavor": "default",
"build_type": "deb",
"build_hash": "4749ba6",
"build_date": "2019-08-19T20:19:25.651794Z",
"build_snapshot": false,
"lucene_version": "8.1.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
So, exactly what I want.
When I curl -k -X GET http://hostname.com:9200
, I receive:
curl: (52) Empty reply from server
It still reaches Elasticsearch, as I get the same log message as with Postman.
[2019-09-04T09:16:17,994][WARN ][o.e.h.AbstractHttpServerTransport] [heartbeats] caught exception w$io.netty.handler.codec.DecoderException: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS$ at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) ~[$ at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) ~$ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerC$ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerC$ at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerCon$ at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.j$ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerC$ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerC$ at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)$ at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.ja$ at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682) [netty-trans$ at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:582) [netty$ at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:536) [netty-tran$ at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [netty-transport-4.1.36.Fin$ at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:$ at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-$ at java.lang.Thread.run(Thread.java:835) [?:?]
Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1206) ~[netty-handle$ at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1274) ~[netty-handler-4.1.36.Fina$ at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessage$ at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) ~[$ ... 16 more
Although I am able to get a reply when accessing https://hostname:9200 with curl, my custombeat still cannot connect to Elasticsearch.
From the beat output:
connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
This is my beat yml-file:
heartbeat:
period: 10s
output.elasticsearch:
hosts: ["https://hostname:9200"]
index: "heartbeats"
protocol: "https"
setup.template.name: "heartbeat"
setup.template.pattern: "heartbeat-*"
setup.ilm.enabled: false
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~