Hey, all. I’m trying to send logstash output to my local InfluxDB. Logstash seems to be unable to find my local InfluxDB. I know this because InfluxDB is not receiving any post or write requests from the logstash file, when I check the logs. I get this error from the logstash logs.
E, [2017-06-22T16:01:00.561000 #10477] ERROR – InfluxDB: Failed to contact host localhost:8086: #<SocketError: initialize: name or service not known> - retrying in 1s.
My logstash configuration file is below. I’ve tried changing the host to “influxdb” or “influx” to no avail.
Is influx bound to localhost, all hosts (e.g. 0.0.0.0), or is an explicit IP like 192.0.2.1?
Binding to a specific IP typically means the service is not available when connecting to localhost. You can do a quick test to confirm whether influx is accessible on localhost, by executing this curl command on the machine where logstash is running:
$ curl -i localhost:8086/ping
Successful output will look something like this:
HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: 1662924f-5790-11e7-9cac-000000000000
X-Influxdb-Version: 1.3.0rc2-c1.3.0rc2
Date: Thu, 22 Jun 2017 21:16:42 GMT
Failed output can vary but will look something like:
curl: (7) Failed to connect to localhost port 8086: Connection refused