<?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: Get Metrics via REST in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728683#M6338</link>
    <description>Hi Rafael,&lt;BR /&gt;Appd output remains in nested json (so that number of lines or size of returned data is minimal)&lt;BR /&gt;But as Daniel mentioned, you need to programmatically convert nested json and flatten it.&lt;BR /&gt;&lt;BR /&gt;For example: &lt;A href="https://www.kaggle.com/jboysen/quick-tutorial-flatten-nested-json-in-pandas" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.kaggle.com/jboysen/quick-tutorial-flatten-nested-json-in-pandas&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It depends upon how you are consuming...possible in java as well.&lt;BR /&gt;&lt;BR /&gt;Hope it helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vaibhav</description>
    <pubDate>Thu, 14 Feb 2019 05:36:34 GMT</pubDate>
    <dc:creator>Vaibhav_Vir_Sin</dc:creator>
    <dc:date>2019-02-14T05:36:34Z</dc:date>
    <item>
      <title>Get Metrics via REST</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728680#M6335</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;we're working to get&amp;nbsp;metrics from appdynamics as json&amp;nbsp;format.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;We are in SaaS controller.&lt;/P&gt;

&lt;P&gt;Our script:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl -s --user 'customer@customer:password' 'https://customer.saas.appdynamics.com/controller/rest/applications/Middleware/metric-data?rollup=false&amp;amp;metric-path=Application%20Infrastructure%20Performance%7C*%7CIndividual%20Nodes%7C*%7CJMX%7CWeb%20Container%20Runtime%7CThreads%20Hogging%20CPU&amp;amp;time-range-type=BETWEEN_TIMES&amp;amp;start-time=1526443200000&amp;amp;end-time=1526450400108&amp;amp;duration-in-mins=15&amp;amp;output=json'&lt;/PRE&gt;

&lt;P&gt;Where is my challenge&amp;nbsp;here: I got all metrics I want (because my rollup=false) 'cause I need all collections. But, when I got the response I see this situation:&lt;/P&gt;

&lt;PRE&gt;{
"metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU",
"metricId": 41065330,
"metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU",
"frequency": "ONE_MIN",
"metricValues": [
{
"occurrences": 1,
"current": 1,
"min": 1,
"max": 1,
"startTimeInMillis": 1526443200000,
"useRange": true,
"count": 1,
"sum": 1,
"value": 1,
"standardDeviation": 0
},
{
"occurrences": 1,
"current": 1,
"min": 1,
"max": 1,
"startTimeInMillis": 1526443260000,
"useRange": true,
"count": 1,
"sum": 1,
"value": 1,
"standardDeviation": 0
},&lt;/PRE&gt;
&lt;P&gt;I have two collect inside one metric. I should split this. I need two arrays, something like:&lt;/P&gt;
&lt;PRE&gt;{
"metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU",
"metricId": 41065330,
"metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU",
"frequency": "ONE_MIN",
"metricValues": [
{
"occurrences": 1,
"current": 1,
"min": 1,
"max": 1,
"startTimeInMillis": 1526443200000,
"useRange": true,
"count": 1,
"sum": 1,
"value": 1,
"standardDeviation": 0
},
{
"metricName": "Server|Component:33111|JMX|Web Container Runtime|Threads Hogging CPU",
"metricId": 41065330,
"metricPath": "Application Infrastructure Performance|Pague_Aqui_OSB_M7|Individual Nodes|op2_sc2_305_01|JMX|Web Container Runtime|Threads Hogging CPU",
"frequency": "ONE_MIN",
"metricValues": [
"occurrences": 1,
"current": 1,
"min": 1,
"max": 1,
"startTimeInMillis": 1526443260000,
"useRange": true,
"count": 1,
"sum": 1,
"value": 1,
"standardDeviation": 0
},&lt;/PRE&gt;

&lt;P&gt;Any idea?&amp;nbsp;It is possible?&lt;/P&gt;

&lt;P&gt;Tks&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 19:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728680#M6335</guid>
      <dc:creator>Rafael_Ielo</dc:creator>
      <dc:date>2018-05-16T19:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get Metrics via REST</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728681#M6336</link>
      <description>&lt;P&gt;The format of Metric API is what you see. You can always convert JSON into form that you desire programmatically&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 17:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728681#M6336</guid>
      <dc:creator>Daniel_Odievich</dc:creator>
      <dc:date>2018-07-10T17:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get Metrics via REST</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728682#M6337</link>
      <description>Hi Daniel,&lt;BR /&gt;&lt;BR /&gt;tks for your reply.&lt;BR /&gt;&lt;BR /&gt;How can I split this ? I know about json output and it is work for me. But my doubt is about how to split this.&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Tue, 10 Jul 2018 18:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728682#M6337</guid>
      <dc:creator>Rafael_Ielo</dc:creator>
      <dc:date>2018-07-10T18:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get Metrics via REST</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728683#M6338</link>
      <description>Hi Rafael,&lt;BR /&gt;Appd output remains in nested json (so that number of lines or size of returned data is minimal)&lt;BR /&gt;But as Daniel mentioned, you need to programmatically convert nested json and flatten it.&lt;BR /&gt;&lt;BR /&gt;For example: &lt;A href="https://www.kaggle.com/jboysen/quick-tutorial-flatten-nested-json-in-pandas" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.kaggle.com/jboysen/quick-tutorial-flatten-nested-json-in-pandas&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It depends upon how you are consuming...possible in java as well.&lt;BR /&gt;&lt;BR /&gt;Hope it helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vaibhav</description>
      <pubDate>Thu, 14 Feb 2019 05:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728683#M6338</guid>
      <dc:creator>Vaibhav_Vir_Sin</dc:creator>
      <dc:date>2019-02-14T05:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get Metrics via REST</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728684#M6339</link>
      <description>&lt;P&gt;Hi Vaibhav, really tks for your reply!&lt;/P&gt;

&lt;P&gt;I've just made&amp;nbsp;using python and pandas to do it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It's beautiful!&lt;/P&gt;

&lt;P&gt;Tks again&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 13:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Get-Metrics-via-REST/m-p/728684#M6339</guid>
      <dc:creator>Rafael_Ielo</dc:creator>
      <dc:date>2019-02-14T13:44:37Z</dc:date>
    </item>
  </channel>
</rss>

