Logstash not able to pass data to elasticsearch

Are you're able to send this to your ES instance:

curl -XPUT "http://hostname:9200/test/test/1" -d '{}'

If you're able to do this, then the issue is on the Logstash side.