[outputs.influxdb] When writing to [http://localhost:8086]: database "telegraf" creation failed: Post "http://localhost:8086/query": dial tcp 127.0.0.1:8086: connect: connection refused

You are writing to a database that does not exists, and the user you are using does not have permissions to create the database (and that’s fine to me since that requires admin permission).

Have a look at your influxDB user permissions and databases, you can create the database manually and give the user appropriate permissions (just WRITE in this case)