<?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: Problem with rex and stats count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115763#M30715</link>
    <description>&lt;P&gt;I futzed around with the rex Marco sent and it worked.  Just for historical purposes, the rex for this is:&lt;BR /&gt;
rex "User\s&amp;lt;(?&lt;USER&gt;[^&amp;gt;]+)&amp;gt;" | stats count by user&lt;BR /&gt;
Thanks again.&lt;/USER&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2014 16:54:40 GMT</pubDate>
    <dc:creator>jpvh12345</dc:creator>
    <dc:date>2014-04-02T16:54:40Z</dc:date>
    <item>
      <title>Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115759#M30711</link>
      <description>&lt;P&gt;I have single-line log entries that come into splunk looking like this:&lt;BR /&gt;
Apr 1 12:34:09 10.1.9.254 %ASA-4-722051: Group &lt;FBTMGMT&gt; User &lt;SAMARTINEZ2&gt; IP &amp;lt;108.81.41.121&amp;gt; Address &amp;lt;172.31.255.91&amp;gt; assigned to session&lt;BR /&gt;
Each entry represents a single login.&lt;BR /&gt;
I would like to have a count of all log entries with individual names that follow in the &amp;lt;&amp;gt; after the "User" phrase.  User is not a field defined so it has to be done with a rex or something at search time.&lt;BR /&gt;
The last thing I've tried is:&lt;BR /&gt;
| rex field=_raw "User\s(?&lt;USER&gt;)" | stats count by _raw&lt;BR /&gt;
but all I get with this is a listing of the individual log entries.&lt;/USER&gt;&lt;/SAMARTINEZ2&gt;&lt;/FBTMGMT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2014 22:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115759#M30711</guid>
      <dc:creator>jpvh12345</dc:creator>
      <dc:date>2014-04-01T22:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115760#M30712</link>
      <description>&lt;P&gt;Search something like &lt;/P&gt;

&lt;P&gt;Group user ip assignment to session | stats count as "login number"&lt;/P&gt;

&lt;P&gt;That's it. &lt;/P&gt;

&lt;P&gt;If instead you want to really use "Rex" you can do something like &lt;/P&gt;

&lt;P&gt;....| rex "User\s&amp;lt;(?&lt;USER&gt;[^&amp;gt;]+)&amp;gt; | stats count(user)&lt;/USER&gt;&lt;/P&gt;

&lt;P&gt;And forget _raw.&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2014 23:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115760#M30712</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-04-01T23:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115761#M30713</link>
      <description>&lt;P&gt;you are correct. But you only miss a small thing in count.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|stats count by user&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 05:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115761#M30713</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-02T05:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115762#M30714</link>
      <description>&lt;P&gt;Thank you, but no, I had already tried stats count by user and that didn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 16:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115762#M30714</guid>
      <dc:creator>jpvh12345</dc:creator>
      <dc:date>2014-04-02T16:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115763#M30715</link>
      <description>&lt;P&gt;I futzed around with the rex Marco sent and it worked.  Just for historical purposes, the rex for this is:&lt;BR /&gt;
rex "User\s&amp;lt;(?&lt;USER&gt;[^&amp;gt;]+)&amp;gt;" | stats count by user&lt;BR /&gt;
Thanks again.&lt;/USER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 16:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115763#M30715</guid>
      <dc:creator>jpvh12345</dc:creator>
      <dc:date>2014-04-02T16:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115764#M30716</link>
      <description>&lt;P&gt;sorry folks for some confusion.. I was writing from my iPad and there was some extra capitalization due to autocorrect....&lt;BR /&gt;
Marco&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 17:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115764#M30716</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-04-02T17:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex and stats count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115765#M30717</link>
      <description>&lt;P&gt;good job.&lt;BR /&gt;
in that way you have the different login for each different user. My stats was counting all events where the field user had a value.&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 17:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-and-stats-count/m-p/115765#M30717</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-04-02T17:06:14Z</dc:date>
    </item>
  </channel>
</rss>

