I want to setup a logstash pipeline with multiple users/passwords and use the different usernames to direct output to different elasticsearch indexes where each username has read/write access to the specific index so same credential can be used over Kibana as well. Something like -
input {
http {
host => "0.0.0.0"
port => 5000
user => "user1","user2"
password => "password1","password2"
}
}
output {
if[user] == "user1" {
elasticsearch {
id => "elastic1"
hosts => ["localhost:9200"]
index => "index1"
user => "user1"
password => "password1"
}
}
else if[user] == "user2" {
elasticsearch {
id => "elastic2"
hosts => ["localhost:9200"]
index => "index2"
user => "user2"
password => "password2"
}
}
}
Is this possible? What am I missing?