I have a filter that I need to apply to each item of an array that I obtain from an earlier filter. It works fine for a single input like this:
http {
url => "http://my.api.com/api/v1/%{id}?verbose=false"
headers => {
"auth" => "auth_string_here"
}
}
However I need to run this same request over an array of ids. I can loop over them with a ruby filter but I can't find a way to make the http request and put the results in a new array of the same length. Is this possible?
mutate {
split => {"ids" => ","}
}
ruby {
event.get('ids').each do |item|
## make get request to 'http://my.api.com/api/v1/item' with auth header
## and put the response in a new array
}