Check if port is open with Logstash/Elasticsearch

I want to be alerted (with wather) if a specific port is closed.

To achiev this i want to create a field with logstash (e.g. port_status), and fill it with open or close, whether the port is open or closed.

How can i check this with logstash? Is it possible with the tcp or udp plugin?
Maybe with the following configuration?

input {  
          tcp {    
            mode => "client"   
            host => "myserver.com"
            port => 1194
       }
    }

I don't think Logstash/Elasticsearch is a terribly good choice for this kind of alerting. Anyway, I don't see how the tcp input can be made useful here. You could however use an exec input that runs something like nc -z myserver.com 1194 ; echo $?.

Thank you, i will see if it Works :slight_smile: