<?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: Searching multiple log messages and count their occurrence in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480419#M192993</link>
    <description>&lt;P&gt;Greetings @asubramanian,&lt;/P&gt;

&lt;P&gt;Here's a run-anywhere search. Adapt it to your needs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           | makeresults | eval _raw = "[ERR] Failed to connect with downstream node"
| append [ | makeresults | eval _raw = "[ERR] Failed to authenticate downstream node" ]
| append [ | makeresults | eval _raw = "[ERR] Downstream node sent invalid response"  ]

| rex "(?&amp;lt;Error&amp;gt;\[ERR\][\w\s]+(node|response))"
| eval ErrorType = case (Error=="[ERR] Failed to connect with downstream node", "NodeConnectionError" ,
                         Error=="[ERR] Downstream node sent invalid response" , "InvalidResponseError",
                         Error=="[ERR] Failed to authenticate downstream node", "AuthenticationError" )
| eval ErrorTypeGeneralized = case (ErrorType=="NodeConnectionError" , "GenericError",
                                    ErrorType=="InvalidResponseError", "GenericError",
                                    ErrorType=="AuthenticationError" , "AuthenticationError")
| timechart limit=0 count by ErrorTypeGeneralized
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Sep 2019 19:29:56 GMT</pubDate>
    <dc:creator>jacobpevans</dc:creator>
    <dc:date>2019-09-12T19:29:56Z</dc:date>
    <item>
      <title>Searching multiple log messages and count their occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480418#M192992</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=my_index
earliest=-30d
"[ERR] Failed to connect with downstream node"
OR "[ERR] Failed to authenticate downstream node"
OR "[ERR] Downstream node sent invalid response"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to get the count of these log messages and plot their count using timechart like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart count(NodeConnectionError), count(AuthenticationError), count(InvalidResponseError) limit=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone let me know how to determine this also is it possible to aggregate few message count like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart (count(NodeConnectionError) + count(InvalidResponseError) ) as GenericError, count(AuthenticationError), limit=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480418#M192992</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-09-12T19:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Searching multiple log messages and count their occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480419#M192993</link>
      <description>&lt;P&gt;Greetings @asubramanian,&lt;/P&gt;

&lt;P&gt;Here's a run-anywhere search. Adapt it to your needs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           | makeresults | eval _raw = "[ERR] Failed to connect with downstream node"
| append [ | makeresults | eval _raw = "[ERR] Failed to authenticate downstream node" ]
| append [ | makeresults | eval _raw = "[ERR] Downstream node sent invalid response"  ]

| rex "(?&amp;lt;Error&amp;gt;\[ERR\][\w\s]+(node|response))"
| eval ErrorType = case (Error=="[ERR] Failed to connect with downstream node", "NodeConnectionError" ,
                         Error=="[ERR] Downstream node sent invalid response" , "InvalidResponseError",
                         Error=="[ERR] Failed to authenticate downstream node", "AuthenticationError" )
| eval ErrorTypeGeneralized = case (ErrorType=="NodeConnectionError" , "GenericError",
                                    ErrorType=="InvalidResponseError", "GenericError",
                                    ErrorType=="AuthenticationError" , "AuthenticationError")
| timechart limit=0 count by ErrorTypeGeneralized
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480419#M192993</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-09-12T19:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Searching multiple log messages and count their occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480420#M192994</link>
      <description>&lt;P&gt;Thanks @jacobevans  for the query, how do i specify the index and duration &lt;/P&gt;

&lt;P&gt;I added the index and duration just before the reg ex search after the last append&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index
earliest=-1d
 | rex "(?&amp;lt;Error&amp;gt;\[ERR\][\w\s]+(node|response))"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and getting an error&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Error in 'append' command: The last argument must be a subsearch.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 20:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-multiple-log-messages-and-count-their-occurrence/m-p/480420#M192994</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-09-12T20:25:50Z</dc:date>
    </item>
  </channel>
</rss>

