<?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 Adding two stat results using one common field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550580#M156244</link>
    <description>&lt;P&gt;Hi guys I have two stats&lt;/P&gt;&lt;P&gt;index |Exception| count&lt;/P&gt;&lt;P&gt;index |Error |count&lt;/P&gt;&lt;P&gt;I want is something like this :&lt;/P&gt;&lt;P&gt;index |Exception|Error |count .&lt;/P&gt;&lt;P&gt;count should be shown for exceptions where it is present for an index and same for Error.&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Exception&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Error&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;&lt;P&gt;index_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArithmeticException&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50&lt;/P&gt;&lt;P&gt;index_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;loginerror&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;index_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;inputerror&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;the count shouldnt mess up due to same index.Please help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 22:59:27 GMT</pubDate>
    <dc:creator>husainpatanwala</dc:creator>
    <dc:date>2021-05-05T22:59:27Z</dc:date>
    <item>
      <title>Adding two stat results using one common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550580#M156244</link>
      <description>&lt;P&gt;Hi guys I have two stats&lt;/P&gt;&lt;P&gt;index |Exception| count&lt;/P&gt;&lt;P&gt;index |Error |count&lt;/P&gt;&lt;P&gt;I want is something like this :&lt;/P&gt;&lt;P&gt;index |Exception|Error |count .&lt;/P&gt;&lt;P&gt;count should be shown for exceptions where it is present for an index and same for Error.&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Exception&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Error&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;&lt;P&gt;index_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArithmeticException&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50&lt;/P&gt;&lt;P&gt;index_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;loginerror&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;index_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;inputerror&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;the count shouldnt mess up due to same index.Please help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 22:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550580#M156244</guid>
      <dc:creator>husainpatanwala</dc:creator>
      <dc:date>2021-05-05T22:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding two stat results using one common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550582#M156245</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234167"&gt;@husainpatanwala&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;stats omits output with null values in the by clause. The simplest way to achieve your desired output where count is greater than zero is to assign empty string values to Exception and Error when they're null:&lt;/P&gt;&lt;P&gt;| eval Exception=coalesce(Exception, ""), Error=coalesce(Error, "")&lt;BR /&gt;| stats count by index Exception Error&lt;/P&gt;&lt;P&gt;The coalesce() eval function is similar to the SQL COALESCE() function and returns the first non-null value in the argument list.&lt;/P&gt;&lt;P&gt;To include Exception and Error values where count is zero, you'll need to define a list of known Exception and Error values, append the list to your output, sort the list by descending count values, and deduplicate the Exception and Error output. Is this your intent?&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 22:58:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550582#M156245</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-05-05T22:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding two stat results using one common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550583#M156246</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search
| stats count by index exception
| append [
   search
  | stats count by index error
  ]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 May 2021 22:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550583#M156246</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-05T22:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Adding two stat results using one common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550584#M156247</link>
      <description>&lt;P&gt;thanks mate,this one seems to be working.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 23:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-two-stat-results-using-one-common-field/m-p/550584#M156247</guid>
      <dc:creator>husainpatanwala</dc:creator>
      <dc:date>2021-05-05T23:07:27Z</dc:date>
    </item>
  </channel>
</rss>

