<?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 How to use span with stats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612015#M212799</link>
    <description>&lt;P&gt;I have a table with the next information:&lt;/P&gt;&lt;P&gt;Fecha&lt;BR /&gt;31/08/2022 16:16:43&lt;BR /&gt;31/08/2022 16:19:48&lt;BR /&gt;31/08/2022 16:16:34&lt;BR /&gt;31/08/2022 16:16:40&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I now want to group these infor&amp;nbsp; by day and hour start and hour end,&amp;nbsp; for example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;31/08/2022&amp;nbsp;16:16:34 -&amp;nbsp;16:19:48&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The query:&lt;/P&gt;&lt;P&gt;index=o365 sourcetype=o365:management:activity Operation=UserLoginFailed user=&lt;BR /&gt;|stats count, values(user) as Usuario by _time&lt;BR /&gt;|eval Fecha = strftime(max(_time), "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;|rename count as Contador&lt;BR /&gt;|sort -Contador&lt;BR /&gt;|table Fecha, Usuario, Contador&lt;BR /&gt;&lt;BR /&gt;Can you help me, please?&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 03:38:22 GMT</pubDate>
    <dc:creator>m0rt1f4g0</dc:creator>
    <dc:date>2022-09-06T03:38:22Z</dc:date>
    <item>
      <title>How to use span with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612015#M212799</link>
      <description>&lt;P&gt;I have a table with the next information:&lt;/P&gt;&lt;P&gt;Fecha&lt;BR /&gt;31/08/2022 16:16:43&lt;BR /&gt;31/08/2022 16:19:48&lt;BR /&gt;31/08/2022 16:16:34&lt;BR /&gt;31/08/2022 16:16:40&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I now want to group these infor&amp;nbsp; by day and hour start and hour end,&amp;nbsp; for example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;31/08/2022&amp;nbsp;16:16:34 -&amp;nbsp;16:19:48&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The query:&lt;/P&gt;&lt;P&gt;index=o365 sourcetype=o365:management:activity Operation=UserLoginFailed user=&lt;BR /&gt;|stats count, values(user) as Usuario by _time&lt;BR /&gt;|eval Fecha = strftime(max(_time), "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;|rename count as Contador&lt;BR /&gt;|sort -Contador&lt;BR /&gt;|table Fecha, Usuario, Contador&lt;BR /&gt;&lt;BR /&gt;Can you help me, please?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612015#M212799</guid>
      <dc:creator>m0rt1f4g0</dc:creator>
      <dc:date>2022-09-06T03:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use span with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612017#M212800</link>
      <description>&lt;P&gt;You use the 'bin' command to specify a time window then stats, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| bin _time span=1h
| stats xxx by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612017#M212800</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-06T03:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use span with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612021#M212801</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;I made the modifications:&lt;/P&gt;&lt;P&gt;The query:&lt;/P&gt;&lt;P&gt;index=o365 sourcetype=o365:management:activity Operation=UserLoginFailed user=esancheza*&lt;BR /&gt;|bin _time span=1h&lt;BR /&gt;|stats count, values(user) as Usuario by _time&lt;BR /&gt;|eval Fecha = strftime(max(_time), "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;|rename count as Contador&lt;BR /&gt;|sort -Contador&lt;BR /&gt;|table Fecha, Usuario, Contador&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But&amp;nbsp;the result is not as expected&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Fecha&lt;BR /&gt;31/08/2022 16:00:00&lt;/P&gt;&lt;P&gt;I would like the next result:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;31/08/2022&amp;nbsp;16:16:34 -&amp;nbsp;16:19:48&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 04:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612021#M212801</guid>
      <dc:creator>m0rt1f4g0</dc:creator>
      <dc:date>2022-09-06T04:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use span with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612024#M212803</link>
      <description>&lt;P&gt;If you are looking to get the counts/users within the 1h window, but also the min/max time of those events, then this will do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... your search...
| eval t=_time
| bin _time span=5m
| stats min(t) as min max(t) as max count, values(user) as Usuario by _time
| eval Fecha=strftime(min, "%d/%m/%Y %T")." - ".strftime(max, "%T")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 04:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612024#M212803</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-06T04:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use span with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612124#M212826</link>
      <description>&lt;P&gt;Wow, You´re amazing!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 17:13:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-span-with-stats/m-p/612124#M212826</guid>
      <dc:creator>m0rt1f4g0</dc:creator>
      <dc:date>2022-09-06T17:13:58Z</dc:date>
    </item>
  </channel>
</rss>

