<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738685#M11056</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/152509"&gt;@Hiroki.Ito&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was able to get the http_poller working and returning an access token and I changed my http filter to--&lt;/P&gt;&lt;P&gt;&lt;EM&gt;http {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;body_format =&amp;gt; "json"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;follow_redirects =&amp;gt; false&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;url =&amp;gt; REST API url taken from one of my metrics&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;verb =&amp;gt; "GET"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;headers =&amp;gt; [ "Authorization", "Bearer %{appd-token}" ]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;target_body =&amp;gt; "[@metadata][api_response]"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;target_headers =&amp;gt; "[@metadata][api_headers]" &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;'appd-token' is from the metadata_target =&amp;gt; "appd-token" property from the http_poller plugin.&lt;/P&gt;&lt;P&gt;That is giving me "response=&amp;gt;"Failed to authenticate: invalid access token." message but I can take the same metrics rest url and run it with curl with no problems getting a json response for the metric that I am querying.&lt;/P&gt;&lt;P&gt;The documentation that I am using here is coming from a post in the Elastic community&lt;/P&gt;&lt;P&gt;&lt;A href="https://discuss.elastic.co/t/http-poller-rest-api-authentication-token/246870/5" target="_blank" rel="nofollow noopener noreferrer"&gt;https://discuss.elastic.co/t/http-poller-rest-api-authentication-token/246870/5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;</description>
    <pubDate>Thu, 21 Oct 2021 15:00:45 GMT</pubDate>
    <dc:creator>Bill_Youngman</dc:creator>
    <dc:date>2021-10-21T15:00:45Z</dc:date>
    <item>
      <title>Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738681#M11052</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;

&lt;P&gt;I am using the http_poller logstash input filter to connect to the AppDynamics OAUTH API that I will then use to pass to the http filter plugin to retrieve AppDynamics REST API metric data to insert into Elasticsearch.&lt;/P&gt;
&lt;P&gt;My logstash http_poller configuration is:&lt;/P&gt;

&lt;P&gt;```&lt;BR /&gt;input {&lt;BR /&gt;http_poller {&lt;BR /&gt;urls =&amp;gt; {&lt;BR /&gt;AppDynamics =&amp;gt; {&lt;BR /&gt;method =&amp;gt; post&lt;BR /&gt;url =&amp;gt; "https://*appdynamics-test-account*/controller/api/oauth/access_token"&lt;BR /&gt;headers =&amp;gt; {&lt;BR /&gt;"Accept" =&amp;gt; "application/json"&lt;BR /&gt;"Content-Type" =&amp;gt; "application/vnd.appd.cntrl+protobuf;v=1"&lt;BR /&gt;"Authorizations" =&amp;gt; "*AppDynamics bearer token*"&lt;BR /&gt;"grant_type" =&amp;gt; "client_credentials"&lt;BR /&gt;"client_id" =&amp;gt; "Stage-CurlTest"&lt;BR /&gt;"client_secret" =&amp;gt; "*AppDynamics Client Secret*"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;request_timeout =&amp;gt; 60&lt;BR /&gt;schedule =&amp;gt; { every =&amp;gt; "1h"}&lt;BR /&gt;codec =&amp;gt; "json"&lt;BR /&gt;metadata_target =&amp;gt; "appd-token"&lt;BR /&gt;type =&amp;gt; "AppDynamics"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;
&lt;P&gt;I am getting the following error response when the poller tries to connect to AppDynamics&lt;/P&gt;
&lt;P&gt;```&lt;BR /&gt;{&lt;BR /&gt;"type": "AppDynamics",&lt;BR /&gt;"@timestamp": "2021-10-18T14:02:11.191Z",&lt;BR /&gt;"appd-token": {&lt;BR /&gt;"request": {&lt;BR /&gt;"method": "post",&lt;BR /&gt;"url": "https://*appdynamics-test-account*/controller/api/oauth/access_token",&lt;BR /&gt;"headers": {&lt;BR /&gt;"Authorizations": "AppDynamics Bearer Token",&lt;BR /&gt;"grant_type": "client_credentials",&lt;BR /&gt;"client_secret": "`AppDynamics Client Secret`",&lt;BR /&gt;"client_id": "Stage-CurlTest",&lt;BR /&gt;"Content-Type": "application/vnd.appd.cntrl+protobuf;v=1",&lt;BR /&gt;"Accept": "application/json"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"response_headers": {&lt;BR /&gt;"x-content-type-options": "nosniff",&lt;BR /&gt;"x-frame-options": "SAMEORIGIN",&lt;BR /&gt;"x-xss-protection": "1; mode=block",&lt;BR /&gt;"connection": "keep-alive",&lt;BR /&gt;"server": "AppDynamics",&lt;BR /&gt;"date": "Mon, 18 Oct 2021 14:02:10 GMT"&lt;BR /&gt;},&lt;BR /&gt;"runtime_seconds": 0.36,&lt;BR /&gt;"host": "SAPPLOG03",&lt;BR /&gt;"name": "AppDynamics",&lt;BR /&gt;"response_message": "Not Acceptable",&lt;BR /&gt;"code": 406,&lt;BR /&gt;"times_retried": 0&lt;BR /&gt;},&lt;BR /&gt;"@version": "1",&lt;BR /&gt;"tags": [&lt;BR /&gt;"_httprequestfailure"&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;
&lt;P&gt;New to both the http_poller filter and the AppDynamics Metric REST API so not sure what I have configured wrong. I have also posted to the Elastic Community forum.&lt;/P&gt;

&lt;P&gt;I have removed any account-specific information for security reasons so any additional information that would be helpful let me know and I'll get it for this post.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;Bill&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 15:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738681#M11052</guid>
      <dc:creator>Bill_Youngman</dc:creator>
      <dc:date>2021-10-18T15:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738682#M11053</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hi &lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/133187"&gt;@Bill.Youngman&lt;/A&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank you for posting to the community.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;First, could you please try curl command below to make sure your apiClientName and client_secret are correct?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://docs.appdynamics.com/21.10/en/extend-appdynamics/appdynamics-apis/api-clients#APIClients-GeneratetheTokenThroughanAPI" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/21.10/en/extend-appdynamics/appdynamics-apis/api-clients#APIClients-GeneratetheTokenThroughanAPI&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;curl -X POST -H “Content-Type: application/vnd.appd.cntrl+protobuf;v=1” “https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;controller&lt;/SPAN&gt; &lt;SPAN&gt;address&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/api/oauth/access_token” -d ‘grant_type=client_credentials&amp;amp;client_id=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;apiClientName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;@&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;accountName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;amp;client_secret=&lt;/SPAN&gt;&lt;SPAN&gt;*AppDynamics Client Secret*&lt;/SPAN&gt;&lt;SPAN&gt;"’&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;The curl command should return access_token.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Then, in your http_poller input, please include the header and body just like the curl command.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Currently, it includes grant_type, client_id, and client_secret in the headers, so they should be in the body.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;In addition, Accept and Authorizations headers are not necessary for the REST API that generates the token. &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Authorization header is necessary for other REST API that uses the generated token.&lt;/SPAN&gt;&lt;/DIV&gt;
e.g.
&lt;PRE&gt;&lt;SPAN&gt; urls =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   AppDynamics =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     method =&amp;gt; post&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     url =&amp;gt; "https://&lt;/SPAN&gt;&lt;SPAN&gt;*appdynamics-test-account*&lt;/SPAN&gt;&lt;SPAN&gt;/controller/api/oauth/access_token"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     body =&amp;gt; "grant_type=client_credentials&amp;amp;client_id=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;apiClientName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;@&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;accountName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;amp;client_secret=&lt;/SPAN&gt;&lt;SPAN&gt;*AppDynamics Client Secret*&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     headers =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;       "Content-Type" =&amp;gt; "application/vnd.appd.cntrl+protobuf;v=1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hiroki&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Oct 2021 02:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738682#M11053</guid>
      <dc:creator>Hiroki_Ito</dc:creator>
      <dc:date>2021-10-20T02:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738683#M11054</link>
      <description>&lt;P&gt;Thanks Hiroki,&lt;/P&gt;&lt;P&gt;That worked and I am getting an access token back but I am still getting an http_request failure even though the response status is 'OK'&lt;/P&gt;&lt;PRE&gt;{&lt;BR /&gt;"tags": [&lt;BR /&gt;"_httprequestfailure"&lt;BR /&gt;],&lt;BR /&gt;"@timestamp": "2021-10-20T13:39:44.541Z",&lt;BR /&gt;"type": "AppDynamics",&lt;BR /&gt;"@version": "1",&lt;BR /&gt;"appd-token": {&lt;BR /&gt;"code": 200,&lt;BR /&gt;"request": {&lt;BR /&gt;"body": "grant_type=client_credentials&amp;amp;client_id=xxxx@vertex-test&amp;amp;client_secret=xxxx",&lt;BR /&gt;"headers": {&lt;BR /&gt;"Content-Type": "application/vnd.appd.cntrl+protobuf;v=1"&lt;BR /&gt;},&lt;BR /&gt;"method": "post",&lt;BR /&gt;"url": "https://xxxx/controller/api/oauth/access_token"&lt;BR /&gt;},&lt;BR /&gt;"name": "AppDynamics",&lt;BR /&gt;"times_retried": 0,&lt;BR /&gt;"response_headers": {&lt;BR /&gt;"x-frame-options": "SAMEORIGIN",&lt;BR /&gt;"content-type": "application/vnd.appd.cntrl+json;v=1",&lt;BR /&gt;"date": "Wed, 20 Oct 2021 13:39:44 GMT",&lt;BR /&gt;"server": "AppDynamics",&lt;BR /&gt;"x-content-type-options": "nosniff",&lt;BR /&gt;"connection": "keep-alive",&lt;BR /&gt;"x-xss-protection": "1; mode=block"&lt;BR /&gt;},&lt;BR /&gt;"runtime_seconds": 0.935,&lt;BR /&gt;"host": "SAPPLOG03",&lt;BR /&gt;"response_message": "OK"&lt;BR /&gt;},&lt;BR /&gt;"expires_in": 3600,&lt;BR /&gt;"access_token": "xxxxx"&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;The filter body of my logstash.conf file looks like this&lt;/P&gt;&lt;PRE&gt;filter {&lt;BR /&gt;if ([type] == "AppDynamics") {&lt;BR /&gt;http {&lt;BR /&gt;body_format =&amp;gt; "json"&lt;BR /&gt;follow_redirects =&amp;gt; false&lt;BR /&gt;body =&amp;gt; {&lt;BR /&gt;"attribute" =&amp;gt; "%{[attribute_value]}"&lt;BR /&gt;}&lt;BR /&gt;url =&amp;gt; "https://xxxx.appdynamics.com/controller/rest/applications/Vertex%20Cloud%20%28Stage%29/metric-data"&lt;BR /&gt;verb =&amp;gt; "GET"&lt;BR /&gt;headers =&amp;gt; [ "Authorization", "Bearer xxxx" ]&lt;BR /&gt;target_body =&amp;gt; "[@metadata][api_response]"&lt;BR /&gt;target_headers =&amp;gt; "[@metadata][api_headers]" &lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;The output section looks like this (which is where the error is being trapped)&lt;/P&gt;&lt;PRE&gt; if ([type] == "AppDynamics") {&lt;BR /&gt;if [http_request_failure] or [http_poller_metadata][code] != 200 {&lt;BR /&gt;file {&lt;BR /&gt;path =&amp;gt; "D:\ELK\Logstash\logstash-7.14.0\logs\AppDynamics_Error.txt"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;file {&lt;BR /&gt;path =&amp;gt; "D:\ELK\Logstash\logstash-7.14.0\logs\AppDynamics.txt"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;My end goal is to get the data from the metrics api into an Elasticsearch index for persistence purposes.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 14:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738683#M11054</guid>
      <dc:creator>Bill_Youngman</dc:creator>
      <dc:date>2021-10-20T14:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738684#M11055</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hi &lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/133187"&gt;@Bill.Youngman&lt;/A&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank you for your reply.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;I think you are getting error with metric-data API.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;As written in the document below, you need to specify metric-path, time-range-type, and duration-in-mins/start-time/end-time in the url of metric data API.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://docs.appdynamics.com/21.10/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-RetrieveMetricData" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/21.10/en/extend-appdynamics/appdynamics-apis/metric-and-snapshot-api#MetricandSnapshotAPI-RetrieveMetricData&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Please try with curl command first, and I think you can configure logstash.conf just like the curl command.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;body_format and body may not be necessary, and you need to include the necessary parameters in the url.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;e.g. of curl command&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;curl -H "Authorization:Bearer &amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;access_token&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;" "http://demo.appdynamics.com/controller/rest/applications/ECommerce_E2E/metric-data?metric-path=Overall%20Application%20Performance%7CAverage%20Response%20Time%20%28ms%29&amp;amp;time-range-type=BEFORE_NOW&amp;amp;duration-in-mins=15"&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hiroki&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Oct 2021 14:28:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738684#M11055</guid>
      <dc:creator>Hiroki_Ito</dc:creator>
      <dc:date>2021-10-21T14:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738685#M11056</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/152509"&gt;@Hiroki.Ito&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was able to get the http_poller working and returning an access token and I changed my http filter to--&lt;/P&gt;&lt;P&gt;&lt;EM&gt;http {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;body_format =&amp;gt; "json"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;follow_redirects =&amp;gt; false&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;url =&amp;gt; REST API url taken from one of my metrics&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;verb =&amp;gt; "GET"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;headers =&amp;gt; [ "Authorization", "Bearer %{appd-token}" ]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;target_body =&amp;gt; "[@metadata][api_response]"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;target_headers =&amp;gt; "[@metadata][api_headers]" &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;'appd-token' is from the metadata_target =&amp;gt; "appd-token" property from the http_poller plugin.&lt;/P&gt;&lt;P&gt;That is giving me "response=&amp;gt;"Failed to authenticate: invalid access token." message but I can take the same metrics rest url and run it with curl with no problems getting a json response for the metric that I am querying.&lt;/P&gt;&lt;P&gt;The documentation that I am using here is coming from a post in the Elastic community&lt;/P&gt;&lt;P&gt;&lt;A href="https://discuss.elastic.co/t/http-poller-rest-api-authentication-token/246870/5" target="_blank" rel="nofollow noopener noreferrer"&gt;https://discuss.elastic.co/t/http-poller-rest-api-authentication-token/246870/5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738685#M11056</guid>
      <dc:creator>Bill_Youngman</dc:creator>
      <dc:date>2021-10-21T15:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738686#M11057</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hi &lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/133187"&gt;@Bill.Youngman&lt;/A&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank you for confirming the curl command for metric data API and changing url in the http filter.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Could you please confirm if %{appd-token} is actually taking the access_token? What happens if it is replaced by %{access_token}?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;It might be possible to debug by configuring the url as %{appd-token} or %{access_token} and check the error message in the log to see if the url is replaced by actual access token.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Regarding logstash configuration, I can't help much.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;However, I could get Average Response time of a BT from metric data API in my local environment, so I am attaching this for reference.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;I hope it helps.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;PRE&gt;&lt;SPAN&gt;input {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  http_poller {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    urls =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    AppD =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      method =&amp;gt; post&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      url =&amp;gt; "https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;controller_url&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/api/oauth/access_token"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      body =&amp;gt; "grant_type=client_credentials&amp;amp;client_id=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;apiClientName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;@&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;accountName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&amp;amp;client_secret=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;appdynamics_client_secret&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      headers =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        "Content-Type" =&amp;gt; "application/vnd.appd.cntrl+protobuf;v=1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  request_timeout =&amp;gt; 60&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  schedule =&amp;gt; { every =&amp;gt; "1m"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  codec =&amp;gt; "json"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;filter{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  http {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    url =&amp;gt; "https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;controller_url&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/rest/applications/&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;application_id&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/metric-data?metric-path=Business%20Transaction%20Performance%7CBusiness%20Transactions%7CTier%7C/BT%7CAverage%20Response%20Time%20%28ms%29&amp;amp;time-range-type=BEFORE_NOW&amp;amp;output=JSON&amp;amp;duration-in-mins=60"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    verb =&amp;gt; "GET"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    headers =&amp;gt; [ "Authorization", "Bearer %{access_token}" ] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hiroki&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Oct 2021 02:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738686#M11057</guid>
      <dc:creator>Hiroki_Ito</dc:creator>
      <dc:date>2021-10-22T02:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738687#M11058</link>
      <description>&lt;P&gt;Hiroki,&lt;/P&gt;&lt;P&gt;I was able to get this solution working. I had my headers field incorrectly configured in the http filter it should have been&amp;nbsp;&lt;/P&gt;&lt;P&gt;headers =&amp;gt; {&lt;BR /&gt;"Authorization" =&amp;gt; "Bearer %{access_token}"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Then I removed the target_response &amp;amp; target_header fields and just let the response data go to the default 'body' field and now everything is working great.&lt;/P&gt;&lt;P&gt;Thanks for all of your help,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 19:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738687#M11058</guid>
      <dc:creator>Bill_Youngman</dc:creator>
      <dc:date>2021-10-22T19:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738688#M11059</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/152509"&gt;@Hiroki.Ito&lt;/A&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm trying to get the API to work with postman or curl. I am not a software developer. I do not know much. But when I try to try the curl you sent, I get an error. Please help.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN&gt;If I have other questions about api, can I write to you?&lt;/SPAN&gt;&lt;/P&gt;


&lt;P&gt;&lt;STRONG&gt;1 - Request cmd&amp;nbsp; :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;curl -X POST -H “Content-Type: application/vnd.appd.cntrl+protobuf;v=1” “&lt;A href="https://appd/controller/api/oauth/access_token”" target="_blank" rel="noopener nofollow noreferrer"&gt;https://appd/controller/api/oauth/access_token”&lt;/A&gt; -d‘grant_type=client_credentials&amp;amp;client_id=Hyetest@customer1&amp;amp;client_secret=36fac97b-xxx-416f-ac4a-d72766d4c073"’&lt;/P&gt;
&lt;P&gt;Grant type value not specified.'client_id' is not recognized as an internal or external command,&lt;BR /&gt;operable program or batch file.&lt;BR /&gt;'client_secret' is not recognized as an internal or external command,&lt;BR /&gt;operable program or batch file.&lt;/P&gt;


&lt;P&gt;&lt;STRONG&gt;2 - Postman Request :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;curl -X POST \&lt;BR /&gt;&lt;A href="https://appd/controller/api/oauth/access_token" target="_blank" rel="noopener nofollow noreferrer"&gt;https://appd/controller/api/oauth/access_token&lt;/A&gt; \&lt;BR /&gt;-H 'authorization: Basic aGFsZXJvbEBjdXN0b21lcjE6Q3liZXJlcmVuNzI5Nw==' \&lt;BR /&gt;-H 'cache-control: no-cache' \&lt;BR /&gt;-H 'content-type: application/x-www-form-urlencoded' \&lt;BR /&gt;-d grant_type=36fac97b-1930-xxx-ac4a-d72799d4c073&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Response :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;No enum constant com.singularity.ee.controller.servlet.api.OAuthAccessTokenResource$GrantType.36FAC97B-xxx-416F-AC4A-D72766D4C073curl: (6) Could not resolve host: \&lt;BR /&gt;curl: (6) Could not resolve host: Basic&lt;BR /&gt;curl: (6) Could not resolve host: aGFsZXJvbEBjdXN0b21lcjE6Q3liZXJlcmVuNzI5Nw=='&lt;BR /&gt;curl: (6) Could not resolve host: \&lt;BR /&gt;curl: (6) Could not resolve host: no-cache'&lt;BR /&gt;curl: (6) Could not resolve host: \&lt;BR /&gt;curl: (6) Could not resolve host: application&lt;BR /&gt;curl: (6) Could not resolve host: \&lt;/P&gt;


&lt;P&gt;&lt;A href="https://docs.appdynamics.com/4.5.x/en/extend-appdynamics/appdynamics-apis/api-clients" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.appdynamics.com/4.5.x/en/extend-appdynamics/appdynamics-apis/api-clients&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 11:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738688#M11059</guid>
      <dc:creator>apm_turkey</dc:creator>
      <dc:date>2022-04-14T11:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738689#M11060</link>
      <description>&lt;DIV&gt;
&lt;P&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/66911"&gt;@apm.turkey&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;

&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to us.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;For curl command to get the token, could you please try command like below?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;curl -X POST -H "Content-Type: application/vnd.appd.cntrl+protobuf;v=1" "https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;controller&lt;/SPAN&gt; &lt;SPAN&gt;address&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/api/oauth/access_token" -d "grant_type=client_credentials" -d "client_id=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;apiClientName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;@&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;accountName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;" -d "client_secret=&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;AppDynamics&lt;/SPAN&gt; &lt;SPAN&gt;Client&lt;/SPAN&gt; &lt;SPAN&gt;Secret&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;"&lt;/SPAN&gt;&lt;/PRE&gt;

&lt;DIV&gt;&lt;SPAN&gt;I am also attaching screenshots to get access token using Postman.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Postman_Header.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/35371iE374FFEC786FC167/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Postman_Body.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/35373i915557B9381045AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;This will return access_token that can be used for other AppDynamics Controller REST APIs.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://docs.appdynamics.com/22.4/en/extend-appdynamics/appdynamics-apis" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/22.4/en/extend-appdynamics/appdynamics-apis&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN&gt;e.g. Requesting applications API&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;curl -H "Authorization:Bearer &amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;access_token&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;" https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;controller&lt;/SPAN&gt; &lt;SPAN&gt;address&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/rest/applications&lt;/SPAN&gt;&lt;/PRE&gt;

&lt;DIV&gt;&lt;SPAN&gt;If you have other questions about API, could you please raise another post?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;This post is for using API with Elastic Logstash http_poller plugin.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hiroki&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Apr 2022 00:26:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738689#M11060</guid>
      <dc:creator>Hiroki_Ito</dc:creator>
      <dc:date>2022-04-15T00:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738690#M11061</link>
      <description>&lt;P&gt;Thank you so much !&lt;/P&gt;&lt;P&gt;Can I send a private question about my other api questions?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738690#M11061</guid>
      <dc:creator>Haluk_Yaşar_Ero</dc:creator>
      <dc:date>2022-04-19T12:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738691#M11062</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/147481"&gt;@Haluk Yaşar.Erol&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;It's preferable to ask questions in the public space of the community. As for the questions you have, others most likely will have too. If an answer is found, it then is able to help many other community members.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Note: I understand some questions may involve sensitive information, if that is the case, redact that information before publishing your post.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 16:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738691#M11062</guid>
      <dc:creator>iamryan</dc:creator>
      <dc:date>2022-04-19T16:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738692#M11063</link>
      <description>I have followed the same steps. Some how I am able to index only Oauth api response instead of Api response. Could you please send me full config file</description>
      <pubDate>Fri, 10 Mar 2023 02:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738692#M11063</guid>
      <dc:creator>Anu_Mungara</dc:creator>
      <dc:date>2023-03-10T02:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using OAUTH API connecting to Elastic Logstash http_poller plugin to get oauth token</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738693#M11064</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.appdynamics.com/t5/user/viewprofilepage/user-id/162639"&gt;@Anu.Mungara&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;

&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank you for the post in the community.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Below is the logstash.conf file I used.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;I have changed the value for controller url, API client name, account name, client secret and application id.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;input {
  http_poller {
    urls =&amp;gt; {
        AppD =&amp;gt; {
            method =&amp;gt; post
            url =&amp;gt; "https://&amp;lt;contorller_url&amp;gt;/controller/api/oauth/access_token"
            body =&amp;gt; "grant_type=client_credentials&amp;amp;client_id=&amp;lt;client_name&amp;gt;@&amp;lt;account_name&amp;gt;&amp;amp;client_secret=&amp;lt;client_secret&amp;gt;"
            headers =&amp;gt; {
                "Content-Type" =&amp;gt; "application/vnd.appd.cntrl+protobuf;v=1"
            }
        }
    }
    request_timeout =&amp;gt; 60
    schedule =&amp;gt; { every =&amp;gt; "1m"}
    codec =&amp;gt; "json"
  }
}

filter{
  http {
    url =&amp;gt; "https://&amp;lt;contorller_url&amp;gt;/controller/rest/applications/&amp;lt;application_id&amp;gt;/metric-data?metric-path=Business%20Transaction%20Performance%7CBusiness%20Transactions%7CJava_Tier%7C/logger%7CAverage%20Response%20Time%20%28ms%29&amp;amp;time-range-type=BEFORE_NOW&amp;amp;output=JSON&amp;amp;duration-in-mins=480"
    verb =&amp;gt; "GET"
    headers =&amp;gt; [ "Authorization", "Bearer %{access_token}" ] 
  }
}

output {
  elasticsearch {
    hosts    =&amp;gt; [ 'elasticsearch' ]
    user     =&amp;gt; 'elastic'
    password =&amp;gt; 'changeme'
  }
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;Please make sure the API URL in filter.http part is the correct URL for a REST API.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;You can use a curl command to confirm if the URL endpoint returns a response by following the steps in the document below.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://docs.appdynamics.com/appd/23.x/latest/en/extend-appdynamics/appdynamics-apis/api-clients#id-.APIClientsv23.1-UsetheAccessTokentoMakeRESTCallsusing-the-access-token" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/appd/23.x/latest/en/extend-appdynamics/appdynamics-apis/api-clients#id-.APIClientsv23.1-UsetheAccessTokentoMakeRESTCallsusing-the-access-token&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;e.g. in the above config file&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;curl -H "Authorization:Bearer &amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;access_token&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;" "https://&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;contorller_url&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/controller/rest/applications/&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;application_id&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;/metric-data?metric-path=Business%20Transaction%20Performance%7CBusiness%20Transactions%7CJava_Tier%7C/logger%7CAverage%20Response%20Time%20%28ms%29&amp;amp;time-range-type=BEFORE_NOW&amp;amp;output=JSON&amp;amp;duration-in-mins=480"&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Hiroki&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Mar 2023 02:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Problem-using-OAUTH-API-connecting-to-Elastic-Logstash-http/m-p/738693#M11064</guid>
      <dc:creator>Hiroki_Ito</dc:creator>
      <dc:date>2023-03-13T02:23:23Z</dc:date>
    </item>
  </channel>
</rss>

