# Websocket input client threw expection- No Method error

**URL:** <https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926>\
**Category:** Logstash\
**Created:** [October 25, 2018, 6:58am UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926 "2018-10-25T06:58:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nidhi\_Mishra](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@Nidhi\_Mishra](https://discuss.elastic.co/u/Nidhi_Mishra)\
**Post date:** [October 25, 2018, 6:58am UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926/1 "2018-10-25T06:58:43Z")

</div>

The Config file of Logstash for the Websocket Client-

```
input {
          websocket {
        	codec => "plain"
        	url => "http://localhost:8080/WebsocketHome/"
          }
        }
output {
          elasticsearch {
            hosts => ["http://localhost:9200"]
            index => "websocket"
            #user => "elastic"
            #password => "changeme"
          }
        }

```

and the following warning comes on the console for logstash:

`websocket input client threw exception, restarting {:exception= #<NoMethodError: undefined method 'each' for #<FTW: :Response: 0x ******** >>}`

And as for Kibana , the no file is getting uploaded.

---

<div class="post-metadata">

**Author:** ![VietCong](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@VietCong](https://discuss.elastic.co/u/VietCong)\
**Post date:** [October 25, 2018, 6:41pm UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926/2 "2018-10-25T18:41:31Z")

</div>

I am running into the same exact issue was well

Please find my pipeline below:

```
input {
    websocket {
      url => "wss://certstream.calidog.io"
       codec => "json"
    }
}
output {
       elasticsearch {
                hosts => ["localhost:9200"]
                index => "calidog"
        }
}

```

Error:  
[WARN] 2018-10-25 17:32:05.483 [[main]\<websocket] websocket - websocket input client threw exception, restarting {:exception=\>#\<NoMethodError: undefined method `each' for #\<FTW::Response:0x7279ccb8\>\>}

---

<div class="post-metadata">

**Author:** ![VietCong](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@VietCong](https://discuss.elastic.co/u/VietCong)\
**Post date:** [October 25, 2018, 11:55pm UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926/3 "2018-10-25T23:55:59Z")

</div>

\*\*Update:

I added the forward slash / to the end of the url like below and receive hanshake\_failure error

input {  
websocket {  
url =\> "wss://certstream.calidog.io/"  
codec =\> "json"  
}  
}

Error:

[2018-10-25T18:52:55,836][WARN][logstash.inputs.websocket] websocket input client threw exception, restarting {:exception=\>#\<OpenSSL::SSL::SSLError: Received fatal alert: handshake\_failure\>}

---

<div class="post-metadata">

**Author:** ![VietCong](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@VietCong](https://discuss.elastic.co/u/VietCong)\
**Post date:** [October 26, 2018, 12:58am UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926/4 "2018-10-26T00:58:24Z")

</div>

Alright, I have tried this and it worked for me. I hope it helps and it was truly a pain researching for solution for this problem. It was a little frustrating with visit many posts relating to this issues and most of them are left without an answer. so I really hope this helps you and potentially many other people

```
  input {
    websocket {
      mode => "client"
      url => "wss://certstream.calidog.io/?param=logstash"
      type => "string"
    }
  }

  output {
    elasticsearch {
      hosts => ["localhost:9200"]
      index => "calidog"
    }
    stdout { codec => rubydebug }
  }

```

so it will complains regardless when the client cannot get data from server but data is still flows.

Happy logstashing!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 23, 2018, 12:58am UTC](https://discuss.elastic.co/t/websocket-input-client-threw-expection-no-method-error/153926/5 "2018-11-23T00:58:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
