<?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: stats count by multiple values with conditions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159043#M44839</link>
    <description>&lt;P&gt;The easiest thing to do here would be to create tags for each value with your desired groups above. Setting the tag "success" on result_action="Success with condition" and so on.&lt;/P&gt;

&lt;P&gt;You could then write a search like:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
index=X1 OR index=X2 OR index=X3 OR index=X4| stats count by tag::result_action&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2013 19:18:16 GMT</pubDate>
    <dc:creator>delink</dc:creator>
    <dc:date>2013-11-27T19:18:16Z</dc:date>
    <item>
      <title>stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159041#M44837</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;i have the following query with results:&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
index=X1 OR index=X2 OR index=X3 OR index=X4| stats count by result_action&lt;/P&gt;

&lt;P&gt;result_action   count&lt;/P&gt;

&lt;P&gt;Failure 356&lt;BR /&gt;
Success 591&lt;BR /&gt;
Failure with condition1 5&lt;BR /&gt;
Success with condition1 58088&lt;BR /&gt;
Check Resource  47245&lt;BR /&gt;
Data Store Error    4&lt;BR /&gt;
Read User Properties    7381&lt;BR /&gt;
User Token Created  38737&lt;BR /&gt;
User Token Failed   77818&lt;/P&gt;

&lt;P&gt;I would like to collapse all result_actions and group them as follows.&lt;/P&gt;

&lt;P&gt;Success= value&lt;BR /&gt;
Failure=value&lt;BR /&gt;
Total=Value&lt;/P&gt;

&lt;P&gt;Could anyone help here&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Ashish&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:11:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159041#M44837</guid>
      <dc:creator>ashishv</dc:creator>
      <dc:date>2013-11-27T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159042#M44838</link>
      <description>&lt;P&gt;Which fields are you counting as failures, and which are successes?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159042#M44838</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-27T19:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159043#M44839</link>
      <description>&lt;P&gt;The easiest thing to do here would be to create tags for each value with your desired groups above. Setting the tag "success" on result_action="Success with condition" and so on.&lt;/P&gt;

&lt;P&gt;You could then write a search like:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
index=X1 OR index=X2 OR index=X3 OR index=X4| stats count by tag::result_action&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159043#M44839</guid>
      <dc:creator>delink</dc:creator>
      <dc:date>2013-11-27T19:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159044#M44840</link>
      <description>&lt;P&gt;if there is a &lt;EM&gt;Fail&lt;/EM&gt; in result_action it is a FAILED &amp;amp; if &lt;EM&gt;Succ&lt;/EM&gt; in result_action it is a SUCCESS.&lt;/P&gt;

&lt;P&gt;thnx&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159044#M44840</guid>
      <dc:creator>ashishv</dc:creator>
      <dc:date>2020-09-28T15:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159045#M44841</link>
      <description>&lt;P&gt;this didnt work i got a "No result found"&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159045#M44841</guid>
      <dc:creator>ashishv</dc:creator>
      <dc:date>2013-11-27T19:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159046#M44842</link>
      <description>&lt;P&gt;Did you go through and add all of the tags on various values of result_action? I was able to run a command like this on my own Splunk instance and count results by tags rather than the original values.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:34:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159046#M44842</guid>
      <dc:creator>delink</dc:creator>
      <dc:date>2013-11-27T19:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159047#M44843</link>
      <description>&lt;P&gt;Sorry, newbie here… not sure how to add Tags.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159047#M44843</guid>
      <dc:creator>ashishv</dc:creator>
      <dc:date>2013-11-27T19:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159048#M44844</link>
      <description>&lt;P&gt;No problem at all. In the search interface, you will want to go into the field picker and make result_action a selected field. It will then show up under each event in the search results. From there, you can click on the result_action=value in an event and you will see a Tag option there. Just add "success" or "failure" for each of the possible result_action values, then the search provided above will work.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159048#M44844</guid>
      <dc:creator>delink</dc:creator>
      <dc:date>2020-09-28T15:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159049#M44845</link>
      <description>&lt;P&gt;Yep that worked, thnx…&lt;/P&gt;

&lt;P&gt;Ashish&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 19:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159049#M44845</guid>
      <dc:creator>ashishv</dc:creator>
      <dc:date>2013-11-27T19:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by multiple values with conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159050#M44846</link>
      <description>&lt;P&gt;Excellent. If you wouldn't mind voting up the answer and selecting it as the correct answer, I would appreciate it.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 20:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-by-multiple-values-with-conditions/m-p/159050#M44846</guid>
      <dc:creator>delink</dc:creator>
      <dc:date>2013-11-27T20:00:21Z</dc:date>
    </item>
  </channel>
</rss>

