Skip to content

Commit

Permalink
x-pack/filebeat/input/websocket: log websocket bad handshake details (#…
Browse files Browse the repository at this point in the history
…41300) (#41301)

Manual cherry pick.

(cherry picked from commit 0c2f9e7)

Co-authored-by: Dan Kortschak <[email protected]>
  • Loading branch information
mergify[bot] and efd6 authored Oct 23, 2024
1 parent f8bd07d commit e2640ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
3 changes: 3 additions & 0 deletions x-pack/filebeat/input/websocket/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2640ca

Please sign in to comment.