I'm trying to send events from LS2.0 to ES2.0+Shield2.0 using basic http authentication but failing because of authentication issue.
OS: centOS 6
ES, LS and Kibana 2.0
Tried solution at http://stackoverflow.com/questions/30781346/logstash-not-writing-to-elasticsearch-with-shield but did not help in CentOS6.
[root@log-receiver logstash]# /opt/logstash/bin/logstash -f /opt/configs/instance_1/logstash-conf.json
Default settings used: Filter workers: 2
Date filter now use BCP47 format for locale, replacing underscore with dash {:level=>:warn}
Failed to install template: [401] {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [logstash] for REST request [/_template/logstash]","header":{"WWW-Authenticate":"Basic realm=\"shield\""}}],"type":"security_exception","reason":"unable to authenticate user [logstash] for REST request [/_template/logstash]","header":{"WWW-Authenticate":"Basic realm=\"shield\""}},"status":401} {:level=>:error}
Logstash startup completed
#Everything was working until installing shield. I know I'm missing something but can't find out. Can some expert help to resolve this issue, please?
#Output of logstash-conf.json:
output {
elasticsearch {
#protocol => "transport"
hosts => [ "es1.domain:9200" ]
keystore => "/opt/keys/ops-cert.pem"
keystore_password => "password_in_plainText"
user => "logstash"
password => "password_in_plainText"
#password => "password_copied_from_es/shielConfig/users"
}
}
At elasticsearch server:
[root@es1 shield]# /usr/share/elasticsearch/bin/shield/esusers roles logstash
logstash : logstash,admin
logstash user role from /etc/elasticsearch/shield/roles.yml
---snip--
logstash:
cluster: indices:admin/template/get, indices:admin/template/put
indices:
'logstash-*':
privileges: indices:data/write/bulk, indices:data/write/delete, indices:data/write/update, indices:data/read/search, indices:data/read/scroll, create_index, cluster:monitor/state