<?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 group by text within a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239853#M71275</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;errorData correlationId="123456789" correlationType="cartItem"&amp;gt;
    &amp;lt;error&amp;gt;
        &amp;lt;errorCode&amp;gt;CART_ERR_111&amp;lt;/errorCode&amp;gt;
        &amp;lt;description&amp;gt;Inventory is not available for the item 123456789.&amp;lt;/description&amp;gt;
        &amp;lt;errorProperties&amp;gt;
            &amp;lt;errorProperty&amp;gt;
                &amp;lt;name&amp;gt;inventory&amp;lt;/name&amp;gt;
                &amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;
            &amp;lt;/errorProperty&amp;gt;
        &amp;lt;/errorProperties&amp;gt;
    &amp;lt;/error&amp;gt;
&amp;lt;/errorData&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 May 2016 16:08:28 GMT</pubDate>
    <dc:creator>proctormap</dc:creator>
    <dc:date>2016-05-19T16:08:28Z</dc:date>
    <item>
      <title>How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239849#M71271</link>
      <description>&lt;P&gt;I am trying to group by text within a specific field. I'm essentially searching a message content field called event. Within this event field, I am searching for specific errorCodes, but I also want to group by the error codes in the result. I'm not able to do an extraction because the message content is in xml format and I can't seem to extract the specific tag. Is there any way to handle this group by ask?&lt;/P&gt;

&lt;P&gt;I want to group the results by unique values within my XML tag. If you couldn't tell...I'm new to this so I'm very appreciative of any guidance you can offer! &lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 21:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239849#M71271</guid>
      <dc:creator>proctormap</dc:creator>
      <dc:date>2016-05-05T21:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239850#M71272</link>
      <description>&lt;P&gt;You can use spath (&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.0/SearchReference/Spath"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.0/SearchReference/Spath&lt;/A&gt;) to extract the field from XML at search time.&lt;/P&gt;

&lt;P&gt;or you can use &lt;STRONG&gt;kvmode&lt;/STRONG&gt; in props&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     KV_MODE = [none|auto|multi|json|xml]
     * Used for search-time field extractions only.
     * Specifies the field/value extraction mode for the data.
     * Set KV_MODE to one of the following:
             * none: if you want no field/value extraction to take place.
             * auto: extracts field/value pairs separated by equal signs.
             * multi: invokes the multikv search command to expand a tabular event into multiple events.
         * xml : automatically extracts fields from XML data.
         * json: automatically extracts fields from JSON data.
     * Setting to 'none' can ensure that one or more user-created regexes are not overridden by
       automatic field/value extraction for a particular host, source, or source type, and also
       increases search performance.
     * Defaults to auto.
     * The 'xml' and 'json' modes will not extract any fields when used on data that isn't of the correct format (JSON or XML).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 May 2016 12:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239850#M71272</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-05-06T12:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239851#M71273</link>
      <description>&lt;P&gt;Thanks for the input Renjith - I tried using spath but my search results look the same as before I included it in my search. Where should my extracted values show up?&lt;/P&gt;

&lt;P&gt;| spath output=errorCode path=cart.errorData.error.errorCode&lt;/P&gt;

&lt;P&gt;I don't believe the KV_mode is an option for me.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 13:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239851#M71273</guid>
      <dc:creator>proctormap</dc:creator>
      <dc:date>2016-05-06T13:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239852#M71274</link>
      <description>&lt;P&gt;Do you have a sample xml snippet to look at ? please do not psot any sensitive data , mask it &lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 05:23:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239852#M71274</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-05-19T05:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239853#M71275</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;errorData correlationId="123456789" correlationType="cartItem"&amp;gt;
    &amp;lt;error&amp;gt;
        &amp;lt;errorCode&amp;gt;CART_ERR_111&amp;lt;/errorCode&amp;gt;
        &amp;lt;description&amp;gt;Inventory is not available for the item 123456789.&amp;lt;/description&amp;gt;
        &amp;lt;errorProperties&amp;gt;
            &amp;lt;errorProperty&amp;gt;
                &amp;lt;name&amp;gt;inventory&amp;lt;/name&amp;gt;
                &amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;
            &amp;lt;/errorProperty&amp;gt;
        &amp;lt;/errorProperties&amp;gt;
    &amp;lt;/error&amp;gt;
&amp;lt;/errorData&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2016 16:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239853#M71275</guid>
      <dc:creator>proctormap</dc:creator>
      <dc:date>2016-05-19T16:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239854#M71276</link>
      <description>&lt;P&gt;here is my spath statement - &lt;/P&gt;

&lt;P&gt;| spath output=errorCode path=cart.errorData.error.errorCode&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 16:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239854#M71276</guid>
      <dc:creator>proctormap</dc:creator>
      <dc:date>2016-05-19T16:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by text within a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239855#M71277</link>
      <description>&lt;P&gt;This is what I tried and I got error code as a field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count|eval abc="&amp;lt;cart&amp;gt;
 &amp;lt;errorData correlationId=\"123456789\" correlationType=\"cartItem\"&amp;gt;
     &amp;lt;error&amp;gt;
         &amp;lt;errorCode&amp;gt;CART_ERR_111&amp;lt;/errorCode&amp;gt;
         &amp;lt;description&amp;gt;Inventory is not available for the item 123456789.&amp;lt;/description&amp;gt;
         &amp;lt;errorProperties&amp;gt;
             &amp;lt;errorProperty&amp;gt;
                 &amp;lt;name&amp;gt;inventory&amp;lt;/name&amp;gt;
                 &amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;
             &amp;lt;/errorProperty&amp;gt;
         &amp;lt;/errorProperties&amp;gt;
     &amp;lt;/error&amp;gt;
 &amp;lt;/errorData&amp;gt;
&amp;lt;/cart&amp;gt;"|spath input=abc output=errorCode path=cart.errorData.error.errorCode|table errorCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2016 04:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-text-within-a-field/m-p/239855#M71277</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-05-24T04:13:09Z</dc:date>
    </item>
  </channel>
</rss>

