One logstash http input with multiple basic auth users

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?

An http input creates an http server port that http clients can connect to. If you are using basic auth then it has a single user and password. If you have multiple http inputs listening on different ports they could have different users.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.