Hi Guys.
I am on logstash 1.5 and I'm trying to use environment plugin and then pass that field value to mongo as part of the URI for the password. This is mainly to mask the password so that it is not in plaintext in logstash.conf
filter {
environment {
add_field_from_env => {
"mongopwd" => "mpwd"
}
}
}
This is my environment plugin setup. I have confirmed that mongopwd field is now referencing mpwd, the environment variable we set. So now mongopwd = "mypassword".
In output for mongodb I am trying to get the value of this field but the combinations i have tried all are not working.
mongodb {
collection => "mydbcollection"
database => "mydb"
uri => "mongodb://user:%{mongopwd}@mymongodb"
}
I have tried ${mongopwd}, mongopwd, [mongopwd] and none are working.
Is my syntax for referencing wrong or am I missing a step?