<?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: Grouping events from bin command to adhere to the lookback time window? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Grouping-events-from-bin-command-to-adhere-to-the-lookback-time/m-p/645490#M16483</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257344"&gt;@justanothersplu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think Bin has just the feature you're looking for: aligntime&lt;/P&gt;&lt;P&gt;You can pass aligntime the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;earliest - snap to the earliest time (down to the second), and let everything bin off that&lt;/LI&gt;&lt;LI&gt;latest - similarly, snap to the latest time&lt;/LI&gt;&lt;LI&gt;&amp;lt;time-specifier&amp;gt; This is what you'll need: set it to&amp;nbsp;@m to snap to the current time to the minute&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;See docs: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Bin#Bin_options" target="_self"&gt;Bin&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try running this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| bin _time span=60m  aligntime=@m&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;All the bins will snap to the current minute, and go back in 60m increments.&lt;BR /&gt;&lt;BR /&gt;Note - this won't work if you set your search time range to end some time in the past, but will work if you only want to snap to the current clock time.&lt;BR /&gt;&lt;BR /&gt;To be able to get buckets to snap to the minute based on your search time and not the clock time, you could try something&amp;nbsp;monstrous like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| bin _time span=60m [ | makeresults | addinfo | eval aligntime=strptime(strftime(info_max_time,"%Y-%m-%d %H:%M:00"),"%Y-%m-%d %H:%M:%S") | table aligntime | return aligntime ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I don't recommend it, but this search will calculate the latest search time to the minute, and use it to add to the bin command.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think the first option will suit your needs best.&lt;/P&gt;&lt;P&gt;cheers,&lt;BR /&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 07:30:06 GMT</pubDate>
    <dc:creator>danspav</dc:creator>
    <dc:date>2023-06-02T07:30:06Z</dc:date>
    <item>
      <title>Grouping events from bin command to adhere to the lookback time window?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Grouping-events-from-bin-command-to-adhere-to-the-lookback-time/m-p/645437#M16482</link>
      <description>&lt;P&gt;I'm running a search coming back with the following logic, the idea here is there I have a bunch of events but I want to use the bin command want span=60m to actually be respective to the time I'm searching ( from 9:27 PM to 10:27PM), instead of snapping to the hour.&amp;nbsp;&lt;BR /&gt;Similar to how when we do earliest=-1h@h, that snaps to the hour and earliest=-60m@m, snaps to the minute, is there a way I can have the bin command snap to the minute and not the hour?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="justanothersplu_1-1685649535062.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25648iF8AEB0F451F4DD4A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="justanothersplu_1-1685649535062.png" alt="justanothersplu_1-1685649535062.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 06:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Grouping-events-from-bin-command-to-adhere-to-the-lookback-time/m-p/645437#M16482</guid>
      <dc:creator>justanothersplu</dc:creator>
      <dc:date>2023-06-02T06:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping events from bin command to adhere to the lookback time window?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Grouping-events-from-bin-command-to-adhere-to-the-lookback-time/m-p/645490#M16483</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257344"&gt;@justanothersplu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think Bin has just the feature you're looking for: aligntime&lt;/P&gt;&lt;P&gt;You can pass aligntime the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;earliest - snap to the earliest time (down to the second), and let everything bin off that&lt;/LI&gt;&lt;LI&gt;latest - similarly, snap to the latest time&lt;/LI&gt;&lt;LI&gt;&amp;lt;time-specifier&amp;gt; This is what you'll need: set it to&amp;nbsp;@m to snap to the current time to the minute&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;See docs: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Bin#Bin_options" target="_self"&gt;Bin&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try running this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| bin _time span=60m  aligntime=@m&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;All the bins will snap to the current minute, and go back in 60m increments.&lt;BR /&gt;&lt;BR /&gt;Note - this won't work if you set your search time range to end some time in the past, but will work if you only want to snap to the current clock time.&lt;BR /&gt;&lt;BR /&gt;To be able to get buckets to snap to the minute based on your search time and not the clock time, you could try something&amp;nbsp;monstrous like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| bin _time span=60m [ | makeresults | addinfo | eval aligntime=strptime(strftime(info_max_time,"%Y-%m-%d %H:%M:00"),"%Y-%m-%d %H:%M:%S") | table aligntime | return aligntime ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I don't recommend it, but this search will calculate the latest search time to the minute, and use it to add to the bin command.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I think the first option will suit your needs best.&lt;/P&gt;&lt;P&gt;cheers,&lt;BR /&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 07:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Grouping-events-from-bin-command-to-adhere-to-the-lookback-time/m-p/645490#M16483</guid>
      <dc:creator>danspav</dc:creator>
      <dc:date>2023-06-02T07:30:06Z</dc:date>
    </item>
  </channel>
</rss>

