<?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 Why are some fields from XML data not displayed in search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280526#M84659</link>
    <description>&lt;P&gt;When I conduct a generic search on one of our Splunk sources, I am looking for relevant data which will assist with categorizing and analyzing the data.&lt;/P&gt;

&lt;P&gt;I noticed that this particular batch of data did not have too many unique identifying fields which were useful for my analysis (eg, customer id, etc).&lt;/P&gt;

&lt;P&gt;However, when I took a closer look at some of the results XML data, I could see that there was indeed some relevant identifying data which was contained within tags. For example, for the purpose of this question lets say;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; customer-id &amp;gt;0100000&amp;lt; /customer-id &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Without the spaces)&lt;/P&gt;

&lt;P&gt;I am wondering why this data does not display as a field which I can manipulate/sort by/etc within the search results.&lt;/P&gt;

&lt;P&gt;Is this not a valid XML tag which is therefore a field?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2016 01:13:53 GMT</pubDate>
    <dc:creator>alexandermunce</dc:creator>
    <dc:date>2016-12-15T01:13:53Z</dc:date>
    <item>
      <title>Why are some fields from XML data not displayed in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280526#M84659</link>
      <description>&lt;P&gt;When I conduct a generic search on one of our Splunk sources, I am looking for relevant data which will assist with categorizing and analyzing the data.&lt;/P&gt;

&lt;P&gt;I noticed that this particular batch of data did not have too many unique identifying fields which were useful for my analysis (eg, customer id, etc).&lt;/P&gt;

&lt;P&gt;However, when I took a closer look at some of the results XML data, I could see that there was indeed some relevant identifying data which was contained within tags. For example, for the purpose of this question lets say;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; customer-id &amp;gt;0100000&amp;lt; /customer-id &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Without the spaces)&lt;/P&gt;

&lt;P&gt;I am wondering why this data does not display as a field which I can manipulate/sort by/etc within the search results.&lt;/P&gt;

&lt;P&gt;Is this not a valid XML tag which is therefore a field?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 01:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280526#M84659</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-15T01:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why are some fields from XML data not displayed in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280527#M84660</link>
      <description>&lt;P&gt;If the data is close it, or is valid XML, Splunk will recognise it and extract the fields. But you usually have to tell splunk that the data is XML.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your search | xmlkv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will tell splunk to extract XML fields at search time. This is however not the most efficient way.&lt;/P&gt;

&lt;P&gt;You can set this in your sourcetype (props.conf)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
KV_MODE = xml 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 09:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280527#M84660</guid>
      <dc:creator>ktugwell_splunk</dc:creator>
      <dc:date>2016-12-15T09:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why are some fields from XML data not displayed in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280528#M84661</link>
      <description>&lt;P&gt;Perfect, thank you kindly!&lt;/P&gt;

&lt;P&gt;Looks like there are too many irrelevant fields extracted if I use the &lt;STRONG&gt;xmlkv&lt;/STRONG&gt; command, so I think I will have to use the &lt;STRONG&gt;rex&lt;/STRONG&gt; command to extract the fields I require!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-are-some-fields-from-XML-data-not-displayed-in-search/m-p/280528#M84661</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-19T23:46:13Z</dc:date>
    </item>
  </channel>
</rss>

