Was able to get my http_poller plugin returning an access token with the following configuration
http_poller {
urls => {
AppDynamics => {
method => post
url => "https://vertex-test.saas.appdynamics.com/controller/api/oauth/access_token"
body => "grant_type=client_credentials&client_id=xxxx@vertex-test&client_secret=xxxx"
headers => {
"Content-Type" => "application/vnd.appd.cntrl+protobuf;v=1"
}
}
}
request_timeout => 60
schedule => { every => "15m"}
codec => "json"
metadata_target => "appd-token"
type => "AppDynamics"
}
But now I am getting an invalid access token error when the http filter plugin fires - this is the config for that
http {
body_format => "json"
follow_redirects => false
url => "https://xxxx.saas.appdynamics.com/controller/rest/applications/Vertex%20Cloud%20%28Stage%29/metric-data?metric-path=Application%20Infrastructure%20Performance%7COSP%20Servers%7CIndividual%20Nodes%7CSOSESB01%7CJVM%7CMemory%7CHeap%7CCurrent%20Usage%20%28MB%29&time-range-type=BEFORE_NOW&duration-in-mins=60"
verb => "GET"
headers => [ "Authorization", "Bearer %{appd-token}" ]
target_body => "[@metadata][api_response]"
target_headers => "[@metadata][api_headers]"
}
I am following the sample given by Yassine Lasri in this post Http_poller REST API authentication token
Getting closer...
Thanks,
Bill