<?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 to use spath to strip HTML from Page Response? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171962#M10582</link>
    <description>&lt;P&gt;It will just be "Ereceipt successfully sent out".  Please view this screen shot:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://screencast.com/t/vXfMwsQmgM"&gt;http://screencast.com/t/vXfMwsQmgM&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 15 Oct 2014 15:23:05 GMT</pubDate>
    <dc:creator>_gkollias</dc:creator>
    <dc:date>2014-10-15T15:23:05Z</dc:date>
    <item>
      <title>How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171960#M10580</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am having trouble stripping HTML from a response from sending eReceipts to customers via dashboard.  Here is the HTML I am trying to strip to only show the message in a pretty human-readable format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;BODY bgcolor=#dddddd&amp;gt; &amp;lt;TABLE bgcolor=#dddddd border=1&amp;gt; &amp;lt;TR&amp;gt; &amp;lt;TD valign="top"&amp;gt;&amp;lt;B&amp;gt;message&amp;lt;/B&amp;gt;&amp;lt;/TD&amp;gt; &amp;lt;TD&amp;gt;Ereceipt successfully sent out&amp;lt;/TD&amp;gt; &amp;lt;/TR&amp;gt; &amp;lt;/TABLE&amp;gt; &amp;lt;/BODY&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For testing, I used this search to strip the initial HTML of the response in the search app (it works):&lt;/P&gt;

&lt;P&gt;| stats count &lt;BR /&gt;
| eval ctgResponse=HTML ABOVE&lt;BR /&gt;
| spath input=ctgResponse output=responseMessage path="BODY.TABLE.TR.TD{2}"&lt;/P&gt;

&lt;P&gt;However, when sending an eReceipt to a customer, the dashboard still displays the HTML formatted response.&lt;/P&gt;

&lt;P&gt;Here is the search behind the dashboard including the spath command (cgereceiptsresubmit is a custom command):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;title&amp;gt;Your Re-Submit Results:&amp;lt;/title&amp;gt;
                &amp;lt;searchString&amp;gt; &amp;lt;![CDATA[ 
|stats count as dummy_field| eval bp_context_id="$bp_context_id$"
| eval PID_OUT="$PID_OUT$"
| eval TPCode="$TPCode$"
| eval OrderNumber="$OrderNumber$"
| eval ShipmentNumber="$ShipmentNumber$"
| eval OrderLink="$OrderLink$"
| eval emailTo="$emailTo$"
| eval emailCC="$emailCC$"
| eval emailBcc="$emailBcc$"
| eval emailSubject="$emailSubject$"
| eval emailBody="$emailBody$"
| fields - dummy_field
| fillnull value=""
| cgereceiptsresubmit
| eval responseMessage=if(responseMessage=="",ctgResponse,responseMessage)
| spath input=ctgResponse output=responseMessage path="BODY.TABLE.TR.TD{2}"
| table resubmit_url,ctg_response, resubmit_error
| rename resubmit_url as "Re-Submit URL", ctg_response as "CTG Response", resubmit_error as "Re-Submit Error Message"
]]&amp;gt;
&amp;lt;/searchString&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any insight on a why this might not be working would be greatly appreciated..&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 13:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171960#M10580</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2014-10-15T13:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171961#M10581</link>
      <description>&lt;P&gt;What is the output you're expecting after stipping html content.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 15:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171961#M10581</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-15T15:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171962#M10582</link>
      <description>&lt;P&gt;It will just be "Ereceipt successfully sent out".  Please view this screen shot:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://screencast.com/t/vXfMwsQmgM"&gt;http://screencast.com/t/vXfMwsQmgM&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 15:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171962#M10582</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2014-10-15T15:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171963#M10583</link>
      <description>&lt;P&gt;Try this instead of spath command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=ctgResponse "\&amp;lt;TD\&amp;gt;(?&amp;lt;ctgResponse&amp;gt;[^\&amp;lt;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Oct 2014 15:36:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171963#M10583</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-15T15:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171964#M10584</link>
      <description>&lt;P&gt;Thanks, but I am still getting the same result using ...| rex field=ctgResponse "(?[^&amp;lt;]+)"&lt;BR /&gt;
...Not 100% sure what the issue is. &lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 15:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171964#M10584</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2014-10-15T15:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171965#M10585</link>
      <description>&lt;P&gt;Try this as your search&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Answer Updated:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |stats count as dummy_field| eval bp_context_id="$bp_context_id$"
| eval PID_OUT="$PID_OUT$"
| eval TPCode="$TPCode$"
| eval OrderNumber="$OrderNumber$"
| eval ShipmentNumber="$ShipmentNumber$"
| eval OrderLink="$OrderLink$"
| eval emailTo="$emailTo$"
| eval emailCC="$emailCC$"
| eval emailBcc="$emailBcc$"
| eval emailSubject="$emailSubject$"
| eval emailBody="$emailBody$"
| fields - dummy_field
| fillnull value=""
| cgereceiptsresubmit
| eval responseMessage=if(responseMessage=="",ctgResponse,responseMessage)
| rex field=responseMessage "\&amp;lt;TD\&amp;gt;(?&amp;lt;responseMessage&amp;gt;[^\&amp;lt;]+)"
| table resubmit_url,responseMessage, resubmit_error
| rename resubmit_url as "Re-Submit URL", responseMessage as "CTG Response", resubmit_error as "Re-Submit Error Message"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Oct 2014 18:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171965#M10585</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-15T18:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use spath to strip HTML from Page Response?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171966#M10586</link>
      <description>&lt;P&gt;This didn't quite work.  What I did was send a test email to my own email account, and the dashboard still sent the eReceipt, however the table is not displaying any message.  Please view the screenshot:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://screencast.com/t/CehgFRg7tr"&gt;http://screencast.com/t/CehgFRg7tr&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;Thanks a lot for your efforts!  Please let me know if there is anything else you need from me to resolve this.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 18:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-spath-to-strip-HTML-from-Page-Response/m-p/171966#M10586</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2014-10-15T18:19:28Z</dc:date>
    </item>
  </channel>
</rss>

