<?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 multi-valued fields from XML? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421681#M27776</link>
    <description>&lt;P&gt;Give it a shot &lt;CODE&gt;index=msperf sourcetype="perfmon_processor_xml" |spath&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 19:48:32 GMT</pubDate>
    <dc:creator>sudosplunk</dc:creator>
    <dc:date>2018-08-24T19:48:32Z</dc:date>
    <item>
      <title>How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421678#M27773</link>
      <description>&lt;P&gt;I have a XML file with multi values on a specific tag (below).&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5625iAACE4D1B57E6D3B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I need to extract the attributes (NAME and CLASSORIGIN) and the VALUE , ignoring the rows without the tag VALUE.&lt;/P&gt;

&lt;P&gt;I loaded the file as a XML and I was able to convert this to a multi-line result but now I need  to extract the fields. Any ideas?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5626i3125E7784EDBDEAC/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 19:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421678#M27773</guid>
      <dc:creator>tamakg</dc:creator>
      <dc:date>2018-08-24T19:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421679#M27774</link>
      <description>&lt;P&gt;Did you try using &lt;CODE&gt;spath&lt;/CODE&gt;. Append &lt;CODE&gt;|spath&lt;/CODE&gt; at the end of your search and see if it works for you.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 19:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421679#M27774</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-24T19:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421680#M27775</link>
      <description>&lt;P&gt;Yes, I did for some reason the fields could not be extracted.&lt;/P&gt;

&lt;P&gt;appending only | spath doesn't show me nothing different. When I try &lt;BR /&gt;
index=msperf sourcetype="perfmon_processor_xml" &lt;BR /&gt;
| xpath outfield=Architecture "//COMMAND/RESULTS/CIM/INSTANCE/PROPERTY" &lt;BR /&gt;
| mvexpand Architecture &lt;BR /&gt;
| table Architecture &lt;BR /&gt;
| where Architecture != "Null" &lt;BR /&gt;
| spath &lt;BR /&gt;
| rename PROPERTY.VALUE as Value &lt;BR /&gt;
| rename PROPERTY.{@NAME} as Name &lt;BR /&gt;
| table Name Value&lt;/P&gt;

&lt;P&gt;the search results nothing. Maybe I'm missing something on the rename command.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:59:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421680#M27775</guid>
      <dc:creator>tamakg</dc:creator>
      <dc:date>2020-09-29T20:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421681#M27776</link>
      <description>&lt;P&gt;Give it a shot &lt;CODE&gt;index=msperf sourcetype="perfmon_processor_xml" |spath&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 19:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421681#M27776</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-24T19:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421682#M27777</link>
      <description>&lt;P&gt;index=msperf sourcetype="perfmon_processor_xml" &lt;BR /&gt;
| spath &lt;BR /&gt;
| rename COMMAND.RESULTS.CIM.INSTANCE.PROPERTY.VALUE as Value &lt;BR /&gt;
| rename COMMAND.RESULTS.CIM.INSTANCE.PROPERTY{@NAME} as Name &lt;BR /&gt;
| table Name Value&lt;/P&gt;

&lt;P&gt;Returned a single row with 2 multi-line fields, but the problem is: some rows doesn't have the VALUE tag and the columns have a different number of values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421682#M27777</guid>
      <dc:creator>tamakg</dc:creator>
      <dc:date>2020-09-29T20:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multi-valued fields from XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421683#M27778</link>
      <description>&lt;P&gt;Solved it.&lt;/P&gt;

&lt;P&gt;index=msperf sourcetype="perfmon_processor_xml" &lt;BR /&gt;
| xpath outfield=Architecture "//COMMAND/RESULTS/CIM/INSTANCE/PROPERTY" &lt;BR /&gt;
| where Architecture != "Null" &lt;BR /&gt;
| table Architecture &lt;BR /&gt;
| mvexpand Architecture &lt;BR /&gt;
| rex field=Architecture "^[^=\n]&lt;EM&gt;=\"(?P\w+)[^=\n]&lt;/EM&gt;=\"(?P[^\"]+)[^&amp;lt;\n]*&amp;lt;\w+&amp;gt;(?P\w+)"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-extract-multi-valued-fields-from-XML/m-p/421683#M27778</guid>
      <dc:creator>tamakg</dc:creator>
      <dc:date>2020-09-29T20:59:56Z</dc:date>
    </item>
  </channel>
</rss>

