<?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: Extract field from XML attribute/element values, spath doesn't quite work out of the box, cant find a solution with xpath in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138036#M8300</link>
    <description>&lt;P&gt;Found the solution &lt;/P&gt;

&lt;P&gt;xpath "//table/table/elem[@key='answer']" outfield=AAA&lt;/P&gt;</description>
    <pubDate>Mon, 16 Feb 2015 12:40:07 GMT</pubDate>
    <dc:creator>phillip_rice</dc:creator>
    <dc:date>2015-02-16T12:40:07Z</dc:date>
    <item>
      <title>Extract field from XML attribute/element values, spath doesn't quite work out of the box, cant find a solution with xpath</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138034#M8298</link>
      <description>&lt;P&gt;Hi, I have the below example XML, when i process this through spath i get the following fields with values created automatically&lt;/P&gt;

&lt;P&gt;xpath "//table/elem/@key" outfield=name&lt;BR /&gt;
The first is just the values &lt;BR /&gt;
answer&lt;BR /&gt;
question&lt;/P&gt;

&lt;P&gt;The second contains the values of the answer and question. &lt;/P&gt;

&lt;P&gt;xpath "//table/elem/" outfield=name&lt;BR /&gt;
true&lt;BR /&gt;
false&lt;BR /&gt;
is it true or false &lt;/P&gt;

&lt;P&gt;etc&lt;/P&gt;

&lt;P&gt;I am trying to extract 2 fields based on the key="answer" and key="name"&lt;/P&gt;

&lt;P&gt;any idea how i can achieve this using spath/xpath etc&lt;/P&gt;

&lt;P&gt;`&lt;BR /&gt;
true&lt;BR /&gt;
is it true or false&lt;/P&gt;

&lt;P&gt;true&lt;BR /&gt;
is it true or false&lt;/P&gt;

&lt;P&gt;false&lt;BR /&gt;
is it true or false&lt;BR /&gt;
`&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 10:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138034#M8298</guid>
      <dc:creator>phillip_rice</dc:creator>
      <dc:date>2015-02-16T10:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from XML attribute/element values, spath doesn't quite work out of the box, cant find a solution with xpath</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138035#M8299</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;table&amp;gt;
&amp;lt;elem key="answer"&amp;gt;true&amp;lt;/elem&amp;gt;
&amp;lt;elem key="name"&amp;gt;Is it true or false&amp;lt;/elem&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;elem key="answer"&amp;gt;true&amp;lt;/elem&amp;gt;
&amp;lt;elem key="name"&amp;gt;Is it true or false&amp;lt;/elem&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;elem key="answer"&amp;gt;false&amp;lt;/elem&amp;gt;
&amp;lt;elem key="name"&amp;gt;Is it true or false&amp;lt;/elem&amp;gt;
&amp;lt;/table&amp;gt;


Adding sample xml
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Feb 2015 10:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138035#M8299</guid>
      <dc:creator>phillip_rice</dc:creator>
      <dc:date>2015-02-16T10:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from XML attribute/element values, spath doesn't quite work out of the box, cant find a solution with xpath</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138036#M8300</link>
      <description>&lt;P&gt;Found the solution &lt;/P&gt;

&lt;P&gt;xpath "//table/table/elem[@key='answer']" outfield=AAA&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 12:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-field-from-XML-attribute-element-values-spath-doesn-t/m-p/138036#M8300</guid>
      <dc:creator>phillip_rice</dc:creator>
      <dc:date>2015-02-16T12:40:07Z</dc:date>
    </item>
  </channel>
</rss>

