Hello guys.
Dont know if it is possible, but i would like to create an array in my logstash to use in an if statement. ill give an example for you to understand me.
Giving a random "log to be processed" as example:
random.log:
Timestamp: 2021-01-26T15:01:38.724Z
user.id: paul@mail.com
user.domain: mail.com
i would like to create an array of users for which i would like to add a department to the logs.
My idea would be something like this:
logstash.conf:
NewArrayFinance => [ {paul@mail.com},{john@mail.com},{mike@mail.com} ]
filter {
if [user][id] in [NewArrayFinace] {
mutate{
add_field => {"Department" => "Finance"}
}
}
}
Later i will also create other "else if's" for other departments. Or maybe you have a easier way to do it.
Thank you alot for your time.