<?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 get a stats count for the same field values that are extracted from different unique sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249779#M74556</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz  sourcetype=abcd |  rex "(i?)\)\s\]\s\-\s(?&amp;lt;err1&amp;gt;Rolling\s\w+\s\w+\s\w+)" | rex "(i?)\)\s\]\s\-\s(?&amp;lt;err2&amp;gt;Could\s\w+\s\w+\s\w+)" | rex "(i?)\:\s(?P&amp;lt;err3&amp;gt;\w+\-\d{5}\:\s\w+\s(constraint))" | rex "(i?)\n(?&amp;lt;err4&amp;gt;Stored\s\w+\s\w+\s\w+)" | rex "(i?)\d\n(?&amp;lt;err5&amp;gt;Pure\s\w+\s\w+)" | table err* | untable dummy fields error | stats count by error
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Oct 2016 20:23:34 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-10T20:23:34Z</dc:date>
    <item>
      <title>How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249774#M74551</link>
      <description>&lt;P&gt;Our logs have errors which we want to extract in a field and get a stats count of those errors.&lt;BR /&gt;
But sample data is different for each error, though they share the same index and sourcetype. We are trying to extract those errors under same field name.&lt;/P&gt;

&lt;P&gt;We successfully extracted all errors with rex, but when I try stats, one or 2 errors are not showing up during count, even though we have that error for the given time frame.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz  sourcetype=abcd |  rex "(i?)\)\s\]\s\-\s(?Rolling\s\w+\s\w+\s\w+)" | rex "(i?)\)\s\]\s\-\s(?Could\s\w+\s\w+\s\w+)" | rex "(i?)\:\s(?P\w+\-\d{5}\:\s\w+\s(constraint))" | rex "(i?)\n(?Stored\s\w+\s\w+\s\w+)" | rex "(i?)\d\n(?Pure\s\w+\s\w+)" | stats count by error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;error                                 count
Could not invoke operation          178
Pure SQL Exception                  100
Rolling back JCA LocalTransaction     320
Stored procedure invocation error    42
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And one of the error is not showing in stats count.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 16:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249774#M74551</guid>
      <dc:creator>sjangampeta</dc:creator>
      <dc:date>2016-10-10T16:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249775#M74552</link>
      <description>&lt;P&gt;The errors that are not showing up in stats count, did they get extracted correctly? In other words, do they show up if you run this query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz  sourcetype=abcd |  rex "(i?)\)\s\]\s\-\s(?Rolling\s\w+\s\w+\s\w+)" | rex "(i?)\)\s\]\s\-\s(?Could\s\w+\s\w+\s\w+)" | rex "(i?)\:\s(?P\w+\-\d{5}\:\s\w+\s(constraint))" | rex "(i?)\n(?Stored\s\w+\s\w+\s\w+)" | rex "(i?)\d\n(?Pure\s\w+\s\w+)" | table _time error _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If not, can you share some sample (sanitized) events with each error text.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 17:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249775#M74552</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-10T17:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249776#M74553</link>
      <description>&lt;P&gt;Could it be possible that one event might have error message that'll match two of your regex? Since you're using same name for field extraction, if an event is matching two rex statement, the 2nd rex will overwrite the 1st and you'll not see the event with that message.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 18:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249776#M74553</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-10T18:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249777#M74554</link>
      <description>&lt;P&gt;Hi Sundaresh, events using table _time error1 error2 error3 error4 error5 displays below events.&lt;BR /&gt;
I see few of errors occuring at the same time.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-10-10 13:52:10 Rolling back JCA LocalTransaction                
2016-10-10 13:52:10     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
2016-10-10 13:51:11 Rolling back JCA LocalTransaction                
2016-10-10 13:51:11     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
2016-10-10 13:51:06 Rolling back JCA LocalTransaction                
2016-10-10 13:51:06     Could not invoke operation      Stored procedure invocation error    
2016-10-10 13:49:31 Rolling back JCA LocalTransaction                
2016-10-10 13:49:31     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
2016-10-10 13:49:24 Rolling back JCA LocalTransaction                
2016-10-10 13:49:24     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
2016-10-10 13:48:40 Rolling back JCA LocalTransaction                
2016-10-10 13:48:40     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
2016-10-10 13:47:34 Rolling back JCA LocalTransaction                
2016-10-10 13:47:34     Could not invoke operation           
2016-10-10 13:47:34                  
2016-10-10 13:47:34                  
2016-10-10 13:46:40 Rolling back JCA LocalTransaction                
2016-10-10 13:46:40     Could not invoke operation  ORA-00001: unique constraint        Pure SQL Exception
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 19:00:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249777#M74554</guid>
      <dc:creator>sjangampeta</dc:creator>
      <dc:date>2016-10-10T19:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249778#M74555</link>
      <description>&lt;P&gt;When search is made using rex, new fields extracted are displaying  correct error values. &lt;BR /&gt;
But if we are using stats , one error (ORA-00001: unique constraint) value is missing. &lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 19:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249778#M74555</guid>
      <dc:creator>sjangampeta</dc:creator>
      <dc:date>2016-10-10T19:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249779#M74556</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz  sourcetype=abcd |  rex "(i?)\)\s\]\s\-\s(?&amp;lt;err1&amp;gt;Rolling\s\w+\s\w+\s\w+)" | rex "(i?)\)\s\]\s\-\s(?&amp;lt;err2&amp;gt;Could\s\w+\s\w+\s\w+)" | rex "(i?)\:\s(?P&amp;lt;err3&amp;gt;\w+\-\d{5}\:\s\w+\s(constraint))" | rex "(i?)\n(?&amp;lt;err4&amp;gt;Stored\s\w+\s\w+\s\w+)" | rex "(i?)\d\n(?&amp;lt;err5&amp;gt;Pure\s\w+\s\w+)" | table err* | untable dummy fields error | stats count by error
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 20:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249779#M74556</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-10T20:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249780#M74557</link>
      <description>&lt;P&gt;Thank you given query is displaying results in correct format, but when i click error to view events, they are not displaying any events.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 21:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249780#M74557</guid>
      <dc:creator>sjangampeta</dc:creator>
      <dc:date>2016-10-10T21:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a stats count for the same field values that are extracted from different unique sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249781#M74558</link>
      <description>&lt;P&gt;If you want to create an interactive report, you will have to create a dashboard. You can save this search as a dashboard panel and add a second 'events' panel with this query. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;index=xyz  sourcetype=abcd "$err$"&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once you have the two panels, edit the source and add the following to the first panel (table with stats)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;drilldown&amp;gt;
&amp;lt;set token="err"&amp;gt;$row.error$&amp;lt;/set&amp;gt;
&amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 22:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-stats-count-for-the-same-field-values-that-are/m-p/249781#M74558</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-10T22:02:17Z</dc:date>
    </item>
  </channel>
</rss>

