<?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 stats count but get all values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645436#M223475</link>
    <description>&lt;P&gt;That has me much closer, thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 19:59:05 GMT</pubDate>
    <dc:creator>secphilomath1</dc:creator>
    <dc:date>2023-06-01T19:59:05Z</dc:date>
    <item>
      <title>How to stats count but get all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645415#M223467</link>
      <description>&lt;P&gt;Here is the search I am trying to do and I hope I can explain this correctly....I am searching for dlp events where there are x events within a period of time for my testing I am using 1 hour...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=epp "content threat" Policy="Content Aware Protection - Content Threat Detected"


`comment("Creating buckets of 10 minutes")`

| bin _time span=1h | stats count values(MatchedItem) by _time ClientUser, DestinationDetails, MatchedItem
| eval PotentialLeak=if(count &amp;gt;= 10, 1, 0)
| search PotentialLeak = 1&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What I am trying to get out of this is a table of the following;&lt;/P&gt;
&lt;P&gt;_time, ClientUser, DestinationDetails, MatchedItem etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I only see one MatchedItem, not all of them for one user I know there is 12 but only see one of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that explains it well enough and appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 18:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645415#M223467</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-06-01T18:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to stats count but get all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645425#M223469</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253046"&gt;@secphilomath1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;As per your search mentioned in the question, after the&amp;nbsp;&lt;STRONG&gt;by&lt;/STRONG&gt; clause, you are using the following terms,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;_time ClientUser, DestinationDetails, &lt;STRONG&gt;MatchedItem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Here, since "&lt;SPAN&gt;MatchedItem&lt;/SPAN&gt;" has been used after the &lt;STRONG&gt;by&lt;/STRONG&gt; clause, its only looking for the &lt;STRONG&gt;values(MatchedItem)&lt;/STRONG&gt; unique to every "&lt;SPAN&gt;MatchedItem", thus you only see one MatchedItem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The correct search should be like following,&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=epp "content threat" Policy="Content Aware Protection - Content Threat Detected"
`comment("Creating buckets of 10 minutes")`
| bin _time span=1h 
| stats count values(MatchedItem) by _time ClientUser, DestinationDetails
| eval PotentialLeak=if(count &amp;gt;= 10, 1, 0)
| search PotentialLeak = 1&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kindly support the answer, if found helpful!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 18:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645425#M223469</guid>
      <dc:creator>seemanshu</dc:creator>
      <dc:date>2023-06-01T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to stats count but get all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645430#M223472</link>
      <description>&lt;P&gt;I'm surprised this works at all since the same field name is used in both the &lt;FONT face="courier new,courier"&gt;values&lt;/FONT&gt; function and in the &lt;FONT face="courier new,courier"&gt;by&lt;/FONT&gt; clause.&lt;/P&gt;&lt;P&gt;Note that &lt;FONT face="courier new,courier"&gt;values&lt;/FONT&gt; removes duplicates so if all 12 are the same then you will see only one.&amp;nbsp; Consider using &lt;FONT face="courier new,courier"&gt;list&lt;/FONT&gt; or this alternative search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=epp "content threat" Policy="Content Aware Protection - Content Threat Detected"

```Creating buckets of 10 minutes```

| bin _time span=1h 
| stats count values(MatchedItem) by _time ClientUser, DestinationDetails
| eval PotentialLeak=if(count &amp;gt;= 10, 1, 0)
| search PotentialLeak = 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 19:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645430#M223472</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-06-01T19:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to stats count but get all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645433#M223474</link>
      <description>&lt;P&gt;Oh yeah, that is exactly what I am seeing now, when I try your search, I still only see the unique values.&amp;nbsp; I will take a look at list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 19:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645433#M223474</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-06-01T19:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to stats count but get all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645436#M223475</link>
      <description>&lt;P&gt;That has me much closer, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 19:59:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stats-count-but-get-all-values/m-p/645436#M223475</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-06-01T19:59:05Z</dc:date>
    </item>
  </channel>
</rss>

