<?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: Grouping by a substring in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349177#M103376</link>
    <description>&lt;P&gt;Perfect, thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 12:50:42 GMT</pubDate>
    <dc:creator>R0ss</dc:creator>
    <dc:date>2017-06-19T12:50:42Z</dc:date>
    <item>
      <title>Grouping by a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349175#M103374</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm having trouble grouping errors in our Splunk logs. The date and time is appended to the error messages, meaning that every message is unique. For example:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Message=2017-06-19 09:15:23,825 ERROR - Here is the error message that we would like to group on...&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I would like to ignore the date/time string and group on the text that appears after this. The best I have come up with is as follows:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Type=Error | eval ErrorString=substr(Message,30,len(Message)) | stats count by ErrorString&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;But this search still seems to evaluate as if the date is present in the new ErrorString string (the count is always 1 and ErrorString's are duplicated across rows)&lt;/P&gt;

&lt;P&gt;Could you help me to write a query that would group the error messages and ignore the date/time.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ross&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349175#M103374</guid>
      <dc:creator>R0ss</dc:creator>
      <dc:date>2017-06-19T09:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping by a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349176#M103375</link>
      <description>&lt;P&gt;You can extract the string at the end and use it in the grouping -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=Message "(?&amp;lt;ErrorString&amp;gt;ERROR.+)"  | stats count by ErrorString
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jun 2017 11:43:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349176#M103375</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-06-19T11:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping by a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349177#M103376</link>
      <description>&lt;P&gt;Perfect, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 12:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-by-a-substring/m-p/349177#M103376</guid>
      <dc:creator>R0ss</dc:creator>
      <dc:date>2017-06-19T12:50:42Z</dc:date>
    </item>
  </channel>
</rss>

