diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 5b24a90e5b0..c0b9a16b384 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -98,6 +98,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - [threatintel] MISP splitting fix for empty responses {issue}38739[38739] {pull}38917[38917] - Prevent GCP Pub/Sub input blockage by increasing default value of `max_outstanding_messages` {issue}35029[35029] {pull}38985[38985] - Updated Websocket input title to align with existing inputs {pull}39006[39006] +- Log bad handshake details when websocket connection fails {pull}41300[41300] *Heartbeat* diff --git a/x-pack/filebeat/input/websocket/input.go b/x-pack/filebeat/input/websocket/input.go index 69810edd944..c63b2a42d9e 100644 --- a/x-pack/filebeat/input/websocket/input.go +++ b/x-pack/filebeat/input/websocket/input.go @@ -113,6 +113,9 @@ func (i input) run(env v2.Context, src *source, cursor map[string]interface{}, p resp.Body.Close() } if err != nil { + if err == websocket.ErrBadHandshake { + log.Errorw("websocket connection failed with bad handshake", "status", resp.StatusCode) + } metrics.errorsTotal.Inc() log.Errorw("failed to establish websocket connection", "error", err) return err