<?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 extract XML attribute names and corresponding values using spath? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113568#M29904</link>
    <description>&lt;P&gt;Sample xml&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2015 21:50:33 GMT</pubDate>
    <dc:creator>premdutt</dc:creator>
    <dc:date>2015-03-24T21:50:33Z</dc:date>
    <item>
      <title>How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113563#M29899</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
Could you please help me on the below request?&lt;/P&gt;

&lt;P&gt;I would like to extract fields like &lt;CODE&gt;RETURNMESSAGE&lt;/CODE&gt;, &lt;CODE&gt;ORIGINALFILENAME&lt;/CODE&gt; , &lt;CODE&gt;STATE&lt;/CODE&gt; and their corresponding values. The search below did not give me any result. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| spath output=AttributeName path=TrkDescriptor.TrkObject.TrkAttr{@name}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2015 03:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113563#M29899</guid>
      <dc:creator>premdutt</dc:creator>
      <dc:date>2015-03-24T03:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113564#M29900</link>
      <description>&lt;P&gt;sample xml&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 03:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113564#M29900</guid>
      <dc:creator>premdutt</dc:creator>
      <dc:date>2015-03-24T03:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113565#M29901</link>
      <description>&lt;P&gt;The sample seems to be missing..&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 03:21:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113565#M29901</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-03-24T03:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113566#M29902</link>
      <description>&lt;P&gt;Can you please share the sample xml?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 12:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113566#M29902</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-03-24T12:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113567#M29903</link>
      <description>&lt;P&gt;can you show example or  send your xml fine??&lt;BR /&gt;
thank.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 12:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113567#M29903</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-03-24T12:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113568#M29904</link>
      <description>&lt;P&gt;Sample xml&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 21:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113568#M29904</guid>
      <dc:creator>premdutt</dc:creator>
      <dc:date>2015-03-24T21:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113569#M29905</link>
      <description>&lt;P&gt;@premdutt&lt;BR /&gt;
Use the 'Code Sample' button (5th button on the textbox menu while you write a comment) to paste the xml else the code is stripped out. &lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 23:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113569#M29905</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-03-24T23:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113570#M29906</link>
      <description>&lt;P&gt;YES send it please&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 18:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113570#M29906</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-03-25T18:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113571#M29907</link>
      <description>&lt;P&gt;Thank you Experts,  i was struggling on adding the sample. &lt;BR /&gt;
Please find the sample xml.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;TrkDescriptor&amp;gt;
&amp;lt;TrkXML VERSION="1.0"/&amp;gt;
&amp;lt;TrkObject&amp;gt;
&amp;lt;TrkAttr name="DIRECTION" val="S"/&amp;gt;
&amp;lt;TrkAttr name="SSLCYPHER" val="A"/&amp;gt;
&amp;lt;TrkAttr name="ISSSL" val="0"/&amp;gt;
&amp;lt;TrkAttr name="ISALERT" val="0"/&amp;gt;

&amp;lt;/TrkObject&amp;gt;
&amp;lt;/TrkDescriptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2015 22:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113571#M29907</guid>
      <dc:creator>premdutt</dc:creator>
      <dc:date>2015-03-26T22:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113572#M29908</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;What sourcetype did you use? I used the "&lt;STRONG&gt;log4net_xml&lt;/STRONG&gt;" as sourcetype and used above query. It worked fine.&lt;/P&gt;

&lt;P&gt;| spath output=AttributeName path=TrkDescriptor.TrkObject.TrkAttr{@name}&lt;/P&gt;

&lt;P&gt;Gave following AttributeNames:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DIRECTION   1   100%    
ISALERT 1   100%    
ISSSL   1   100%    
SSLCYPHER   1   100%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2015 12:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113572#M29908</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-03-30T12:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113573#M29909</link>
      <description>&lt;P&gt;And how to filter results to only show the TrkAttr name when the TrkAttr val is = 0?&lt;BR /&gt;
The output should be&lt;BR /&gt;
ISSSL&lt;BR /&gt;
ISALERT&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113573#M29909</guid>
      <dc:creator>fabioportes</dc:creator>
      <dc:date>2016-01-21T20:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract XML attribute names and corresponding values using spath?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113574#M29910</link>
      <description>&lt;P&gt;Did you ever figure this out?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 13:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-XML-attribute-names-and-corresponding-values/m-p/113574#M29910</guid>
      <dc:creator>gregbo</dc:creator>
      <dc:date>2018-09-13T13:04:36Z</dc:date>
    </item>
  </channel>
</rss>

