<?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: JSON parse with http monitor in Synthetic Monitoring</title>
    <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/186525#M1324</link>
    <description>&lt;P&gt;Is it a specific service you are interested in or do you need to know for each service?&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2022 08:54:49 GMT</pubDate>
    <dc:creator>HannahM</dc:creator>
    <dc:date>2022-05-16T08:54:49Z</dc:date>
    <item>
      <title>JSON parse with http monitor</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/186384#M1321</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;I would like to parse a json file with an http monitor this is my json&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"services":&lt;/SPAN&gt; &lt;SPAN&gt;[&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;true,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Communes",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;200&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Commune Service"&lt;/SPAN&gt; &lt;SPAN&gt;},&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;true,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Annexe Groupe",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;200&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Documents Service"&lt;/SPAN&gt; &lt;SPAN&gt;},&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;false,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Obtenir Disponibilité",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;500&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Utilisateurs Service"&lt;/SPAN&gt; &lt;SPAN&gt;},&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;true,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Verifier Cheque",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;200&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Platefor"&lt;/SPAN&gt; &lt;SPAN&gt;},&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;true,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Personne",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;200&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Personne"&lt;/SPAN&gt; &lt;SPAN&gt;},&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt; &lt;SPAN&gt;"available":&lt;/SPAN&gt; &lt;SPAN&gt;true,&lt;/SPAN&gt; &lt;SPAN&gt;"operation":&lt;/SPAN&gt; &lt;SPAN&gt;"Recherche",&lt;/SPAN&gt; &lt;SPAN&gt;"responsecode":&lt;/SPAN&gt; &lt;STRONG&gt;200&lt;/STRONG&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;"service":&lt;/SPAN&gt; &lt;SPAN&gt;"Contrat"&lt;/SPAN&gt; &lt;SPAN&gt;}&lt;/SPAN&gt; &lt;SPAN&gt;]&lt;/SPAN&gt; &lt;SPAN&gt;}&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how I could get the status&lt;BR /&gt;"available": true,&lt;/P&gt;&lt;P&gt;and make a warning if is set by false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx for help !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 13:41:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/186384#M1321</guid>
      <dc:creator>jimmy</dc:creator>
      <dc:date>2022-05-12T13:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parse with http monitor</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/186525#M1324</link>
      <description>&lt;P&gt;Is it a specific service you are interested in or do you need to know for each service?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 08:54:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/186525#M1324</guid>
      <dc:creator>HannahM</dc:creator>
      <dc:date>2022-05-16T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parse with http monitor</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/187388#M1342</link>
      <description>&lt;P&gt;Hi thx for answer me !&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is for each service&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 10:36:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/187388#M1342</guid>
      <dc:creator>jimmy</dc:creator>
      <dc:date>2022-05-30T10:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parse with http monitor</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/187863#M1355</link>
      <description>&lt;P&gt;You can get the response and parse as json like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG data-stringify-type="bold"&gt;&lt;I data-stringify-type="italic"&gt;var responseBody = response.getResponseBody();&lt;/I&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG data-stringify-type="bold"&gt;&lt;I data-stringify-type="italic"&gt;var jsonData = JSON.parse(responseBody);&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You will then need to iterate through each service checking for the status. You can then either use &lt;A href="https://www.dynatrace.com/support/help/how-to-use-dynatrace/synthetic-monitoring/http-monitors/pre-and-post-scripting-for-http-monitors#end" target="_blank" rel="noopener"&gt;api.fail()&lt;/A&gt; directly to fail the monitor as soon as you find a service that is not available or you can set a variable and then check it once you have checked all the services and then fail the monitor with a message that states which services were not available.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 11:30:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/JSON-parse-with-http-monitor/m-p/187863#M1355</guid>
      <dc:creator>HannahM</dc:creator>
      <dc:date>2022-06-06T11:30:01Z</dc:date>
    </item>
  </channel>
</rss>

