connectionError in ubuntu

I installed docker on ubuntu and ran
docker run -d -p 9200:9200 -p 5601:5601 nshou/elasticsearch-kibana
so now I have Elasticsearch running as a container on docker.

I am using python and a module called Tweepy to insert data into elasticsearch like this:

es.index(index="sentiment", doc_type="test-type", body={"author": dict_data["user"]["screen_name"], "favoriteCount": dict_data["favorite_count"], "tweetID": dict_data["id"], "lang": dict_data["lang"], "tweetID": dict_data["id"], "date": dict_data["created_at"], "message": dict_data["text"], "polarity": tweet.sentiment.polarity, "subjectivity": tweet.sentiment.subjectivity, "sentiment": sentiment})

and I am running it. I want to download all the data to a csv file.

I found es2csv here https://github.com/taraslayshchuk/es2csv

Using ssh I tried this
es2csv -q 'host: localhost' -o database.csv

but I get this:
root@elk:~# es2csv -t dev -q 'host: localhost' -o database.csv
ConnectionError(('Connection aborted.', BadStatusLine("''",))) caused by: ProtocolError(('Connection aborted.', BadStatusLine("''",)))

Using ssh I tried this
es2csv -u 128.199.237.228:9200 -q '*' -o database.csv

but I get this
ConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb51b59d3d0>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb51b59d3d0>: Failed to establish a new connection: [Errno 111] Connection refused)

Can anyone guess what the correct way to get this to work would be? I don't really understand networking and so I cannot figure out what these kinds of errors are.

FYI your cluster is exposed to the internet, you may want to redact your IP from the post.