HTTP Poller authentication: encode token

Hello,
I am trying to use the HTTP Poller input plugin to get data from an API. Although, I need to authenticate with a basic authentication, with username and token. This would be a problem if the token didn't have to be encoded... Is there a way to use a function such as encode64(token) in this input?
If this is not possible I think I can do it with a curl command in exec input.
Here is what my input config looks like:

http_poller {
		urls => {
			jenkins_metrics => {
				url => "https://url.to.api/"
				headers => {
					Accept => "application/json"
					Authorization => "Basic username:token"
			}
		codec => json
		}
	}
	schedule => { cron => "* * * * *" }
}

Your overcomplicating things; just use the plugin's user and password options.

I guess you're right.
Thanks for the quick answer!

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