ERR Connecting error publishing events (retrying): dial tcp x.x.x.x:5044: getsockopt: connection refused

Have you verified that Logstash is starting up okay and actually listening on port 5044 (check with netstat)? What's the firewall situation?