Logstash communication fails to ES with x-pack with user logstash_internal

input {}
filter {}

output {
elasticsearch {
hosts => ["http://localhost:9200"]
user => "logstash_internal"
password => "somepassword"
manage_template => "false"
template_name => "logstash"
}
}

Configuration OK
[INFO ] 2019-06-04 15:54:47.199 [LogStash::Runner] runner - Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash

Can you remove the template_name and try again?

Your problem looks similar to the: Failed to install template logstash error