<?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 list count of Error messages in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203464#M176685</link>
    <description>&lt;P&gt;Yep in this case the answer of richgalloway is the more accurate. As I said. It only was quick and dirty.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 13:56:14 GMT</pubDate>
    <dc:creator>PPape</dc:creator>
    <dc:date>2016-09-20T13:56:14Z</dc:date>
    <item>
      <title>How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203459#M176680</link>
      <description>&lt;P&gt;I have multiple error messages in the logs and I do count by ErrorMessage. The error messages gets listed as below.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;ErrorMessage&lt;/STRONG&gt;                                                                                                                                           &lt;STRONG&gt;Count&lt;/STRONG&gt;&lt;BR /&gt;
Execute Hedging Failed                                                                                                                                    &lt;STRONG&gt;427&lt;/STRONG&gt;&lt;BR /&gt;
Execute Risk Failed                                                                                                                                           &lt;STRONG&gt;727&lt;/STRONG&gt;&lt;BR /&gt;
Unable to create parallel trade for trade ID 12345                                                                                     &lt;STRONG&gt;400&lt;/STRONG&gt;&lt;BR /&gt;
Unable to create parallel trade for trade ID 23456                                                                                     &lt;STRONG&gt;326&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;In the table above error message 1 and 2 are valid but the 3rd and 4th are the same except for the trade ID difference. I want to tweak my query in such a way that 3 and 4 are joined together and I get  Unable to create parallel trade &lt;STRONG&gt;726&lt;/STRONG&gt; (400+326).&lt;/P&gt;

&lt;P&gt;My current query: index=XYZ sourcetype="Apache Log" Error | Stats count by PT_ErrMsg.  PT_ErrMsg is field extract created for getting error message.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203459#M176680</guid>
      <dc:creator>AravindSridhara</dc:creator>
      <dc:date>2020-09-29T11:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203460#M176681</link>
      <description>&lt;P&gt;You'll need to convert similar error messages into a common form.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XYZ sourcetype="Apache Log" Error | eval PT_ErrMsg=case(match(PT_ErrMsg,"Unable to create parallel trade for trade ID.*"),"Unable to create parallel trade for trade ID" , 1=1, PT_ErrMsg) | Stats count by PT_ErrMsg
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Sep 2016 12:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203460#M176681</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-09-20T12:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203461#M176682</link>
      <description>&lt;P&gt;quick and dirty:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XYZ sourcetype="Apache Log" Error | eval ErrorMsg = if(like(PT_ErrMsg,"Unable to create parallel trade for trade ID%"),"Unable to create parallel trade for trade ID",PT_ErrMsg) | Stats count by PT_ErrMsg 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Sep 2016 12:41:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203461#M176682</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-09-20T12:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203462#M176683</link>
      <description>&lt;P&gt;Thanks it is working. What I should do if I want to do this for multiple error messages along with the one i mentioned above. For example&lt;BR /&gt;
 Failed to create trade for ID 1234 &lt;STRONG&gt;124&lt;/STRONG&gt; Failed to create for ID 3214 &lt;STRONG&gt;470&lt;/STRONG&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 13:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203462#M176683</guid>
      <dc:creator>AravindSridhara</dc:creator>
      <dc:date>2016-09-20T13:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203463#M176684</link>
      <description>&lt;P&gt;That's where the case statement in my answer is useful.  Just add an entry to it for each message.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 13:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203463#M176684</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-09-20T13:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203464#M176685</link>
      <description>&lt;P&gt;Yep in this case the answer of richgalloway is the more accurate. As I said. It only was quick and dirty.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 13:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203464#M176685</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-09-20T13:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203465#M176686</link>
      <description>&lt;P&gt;Hi Richgalloway, this is not working even for the message you have provided. It is listing all the unable to create trade.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 11:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203465#M176686</guid>
      <dc:creator>AravindSridhara</dc:creator>
      <dc:date>2016-09-21T11:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to list count of Error messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203466#M176687</link>
      <description>&lt;P&gt;I used the wrong wildcard in the &lt;CODE&gt;match&lt;/CODE&gt; command.  The edited answer should work.  Or you can use &lt;CODE&gt;like&lt;/CODE&gt; as in PPape's answer.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 12:00:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-count-of-Error-messages/m-p/203466#M176687</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-09-21T12:00:31Z</dc:date>
    </item>
  </channel>
</rss>

