<?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: How can I index JSON that's embedded in HMTL? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284380#M33798</link>
    <description>&lt;P&gt;Even better! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2017 19:23:05 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2017-02-10T19:23:05Z</dc:date>
    <item>
      <title>How can I index JSON that's embedded in HMTL?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284377#M33795</link>
      <description>&lt;P&gt;I'm querying an endpoint that is returning JSON embedded in HTML.  Like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt; &amp;lt;pre id="info"&amp;gt;...&amp;lt;/pre&amp;gt; &amp;amp;lt;br/&amp;amp;gt; &amp;lt;script&amp;gt;document.getElementById("info").innerHTML = JSON.stringify({"perfInfo":{"processes":79,"threads":1662,"PhysicalAvailable":11717,"PhysicalTotal":16383,"CommitTotal":5856,"CommitLimit":22525,"CommitPeak":7155,"KernelNonpaged":100,"KernelPaged":209,"KernelTotal":310},"sysInfo":{"powerProfile":"7","hostname":"HOSTNAME","Version":"7.5.0.206","UDI":"(01)00853866003209(11)170203(10)7.5.0.206","BootstrapperProfile":"Enterprise - Management","hwProductName":"VMware Virtual Platform","hwBIOSVersion":"6.00","osVersion":"Windows Server 2012 (R2) (6.3 Server build 9600)"},"gpuInfo":{"numGPUs":0},"Sessions":{"available":1,"capacity":1,"assigned":[],"passive":0,"allowingNewConnections":true},"slots":{"totalSlots":1,"availableSlots":1,"passiveSlots":0,"userRamReservedMB":15559,"userRamRemainingMB":13639}}
, null, 4); &amp;lt;/script&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want just the JSON but I'm having a hell of a time figuring out how to strip away or ignore the HTML.  Could anyone offer some pointers?  TIA!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 14:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284377#M33795</guid>
      <dc:creator>mgagliardi</dc:creator>
      <dc:date>2017-02-10T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I index JSON that's embedded in HMTL?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284378#M33796</link>
      <description>&lt;P&gt;Configure this in props.conf for your sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
SEDCMD-removeHTMLBeginning = s/&amp;lt;HTML&amp;gt;[\s\S]*\(\{/{/g
SEDCMD-removeHTMLEnd = s/\}\}[\s\S]*$/}}/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That worked for me with your sample response.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284378#M33796</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-02-10T18:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I index JSON that's embedded in HMTL?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284379#M33797</link>
      <description>&lt;P&gt;FWIW your answer works, but I also found that setting an HTTP header of Accept=application/json got me where I wanted to go (via the REST API data source).&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284379#M33797</guid>
      <dc:creator>mgagliardi</dc:creator>
      <dc:date>2017-02-10T19:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I index JSON that's embedded in HMTL?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284380#M33798</link>
      <description>&lt;P&gt;Even better! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-can-I-index-JSON-that-s-embedded-in-HMTL/m-p/284380#M33798</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-02-10T19:23:05Z</dc:date>
    </item>
  </channel>
</rss>

