<?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: i need to extract fields from XML in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222002#M188186</link>
    <description>&lt;P&gt;How is your data ingested? Is this a raw events OR value of a field? Did you ingested this data with configuration to parse this as an XML event? What is your current search?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2016 16:52:26 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-08-10T16:52:26Z</dc:date>
    <item>
      <title>i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222001#M188185</link>
      <description>&lt;P&gt;from this data i want to extract theses fields "Message", "Query" and "Row". when i try to extract i am getting error that i am extracting multiple fields. i haven't had issues with field extraction prior to this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Check&amp;gt;
    &amp;lt;Message&amp;gt;Machine without MachinePersonnel&amp;lt;/Message&amp;gt;
    &amp;lt;Query&amp;gt;
SELECT
    Machine.CorporateName
FROM Machine Machine
LEFT OUTER JOIN MachinePersonnel MachinePersonnel
ON Machine.CorporateName = MachinePersonnel.Machine
WHERE MachinePersonnel.Machine IS NULL
    &amp;lt;/QUERY&amp;gt;

    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;adx07mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;rns01mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;log01mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;log03mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;svr02mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
    &amp;lt;Row&amp;gt;
        &amp;lt;CorporateName&amp;gt;san01mrbotn&amp;lt;/CorporateName&amp;gt;
    &amp;lt;/Row&amp;gt;
&amp;lt;/Check&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;**&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222001#M188185</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-08-10T16:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222002#M188186</link>
      <description>&lt;P&gt;How is your data ingested? Is this a raw events OR value of a field? Did you ingested this data with configuration to parse this as an XML event? What is your current search?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222002#M188186</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-10T16:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222003#M188187</link>
      <description>&lt;P&gt;This works when i just shove all that xml into the _raw field with an eval statement.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| xpath outfield=CorporateName "//Check/Row/CorporateName" 
| xpath outfield=Query "//Check/Query" 
| xpath outfield=Message "//Check/Message"
| table CorporateName Query Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As somesoni2 mentioned, we need more details on how you're trying to extract.  The example I just gave only works if you're indexing these as complete events.&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/1705iD1AE555BC823F229/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>Wed, 10 Aug 2016 17:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222003#M188187</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-10T17:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222004#M188188</link>
      <description>&lt;P&gt;raw event&lt;/P&gt;

&lt;P&gt;search=&lt;BR /&gt;
sourcetype=DBIntegrity&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 17:08:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222004#M188188</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-08-10T17:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222005#M188189</link>
      <description>&lt;P&gt;sorry i ran out of replies the other day. this is getting the data separated in to the fields i need. but i still would like to know why the field extraction tool doesn't work for this. i have never had issues with it in the past. and i can't attach a snip of what i want to show you.. urg..&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 14:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222005#M188189</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-08-12T14:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222006#M188190</link>
      <description>&lt;P&gt;sorry i ran out of replies the other day. this is getting the data separated in to the fields i need. but i still would like to know why the field extraction tool doesn't work for this. i have never had issues with it in the past. and i can't attach a snip of what i want to show you.. urg..&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 16:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222006#M188190</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-08-12T16:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222007#M188191</link>
      <description>&lt;P&gt;The problem you will run in to with field extractions, is number of occurrences. IFX only handles single occurrence. You have couple of options&lt;/P&gt;

&lt;P&gt;1) Edit props/transforms and include &lt;CODE&gt;MV_ADD=true&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;2) Use the field transformations UI to add it from there. Check the &lt;CODE&gt;create multivalue field&lt;/CODE&gt; checkbox. Something like this for your regex should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Regex: `(CorporateName)\&amp;gt;([^\&amp;lt;]+)`
Format: `$1::$2`
create multivalue field: `checked`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create a multivalue field called CorporateName with all instances in that field. You can then use &lt;CODE&gt;mvexpand&lt;/CODE&gt; in your search to expand them in to rows.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/Knowledge/Managefieldtransforms"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.2/Knowledge/Managefieldtransforms&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 17:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222007#M188191</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-12T17:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: i need to extract fields from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222008#M188192</link>
      <description>&lt;P&gt;The reason the IFX (interactive field extractor) isn't working is because it's extracting multiple values for the same key/field in each event.  See sundaresh's reply below.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 20:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/i-need-to-extract-fields-from-XML/m-p/222008#M188192</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-12T20:01:35Z</dc:date>
    </item>
  </channel>
</rss>

