I am able to successfully get an access token from the http_poller plugin but now I need to pass that token on to the http filter in order to make my REST call.
I'm assuming that I need to do this through the headers field in the http filter such as
headers => ["Authorization", "Bearer xxxx-token from http_poller"] but not sure how to this dynamically so that it uses the token from the http_poller plugin.
New to these two plugins so any help / direction is greatly appreciated.
My access token is being returned in the access_token field from the http_poller plugin and my http filter is configured like this
http {
body_format => "json"
follow_redirects => false
body => {
"attribute" => "%{[attribute_value]}"
}
url => REST API URL
verb => "GET"
headers => [ "Authorization", "Bearer %{access_token}" ]
target_body => "[@metadata][api_response]"
target_headers => "[@metadata][api_headers]"
}
Pretty sure that I have the 'headers' section set up wrong but was trying to get a starting point.
Thanks,
Bill