<?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: Latest values for every 4 hours time interval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608912#M211735</link>
    <description>&lt;P&gt;Alternatively, if they are already in descending time order, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin StartTime span=4h
| dedup StartTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 20:57:34 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-09T20:57:34Z</dc:date>
    <item>
      <title>How to pull latest values for every 4 hours time interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608907#M211732</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm trying to&amp;nbsp; pull the latest values for every 4 hours in a day ie., latest values between the time&lt;BR /&gt;00:00:00 to 04:00:00,&amp;nbsp;04:00:00 to&amp;nbsp;08:00:00,&amp;nbsp;08:00:00 to 12:00:000, 12:00:00 to 16:00:00.... Below is the example of how&amp;nbsp;the data looks like. TIA&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bnikhil0584_0-1660077734084.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20962i2B4525FC886FAE6C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bnikhil0584_0-1660077734084.png" alt="bnikhil0584_0-1660077734084.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 20:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608907#M211732</guid>
      <dc:creator>bnikhil0584</dc:creator>
      <dc:date>2022-08-09T20:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Latest values for every 4 hours time interval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608911#M211734</link>
      <description>&lt;P&gt;Assuming StartTime is an epoch time and events are ascending time order&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin StartTime span=4h
| stats latest(field1) as field1 by StartTime&lt;/LI-CODE&gt;&lt;P&gt;If not, precede with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval StartTime=strptime(StartTime,"%m/%d/%Y %H:%M")
| sort 0 StartTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 20:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608911#M211734</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-09T20:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Latest values for every 4 hours time interval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608912#M211735</link>
      <description>&lt;P&gt;Alternatively, if they are already in descending time order, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin StartTime span=4h
| dedup StartTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 20:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608912#M211735</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-09T20:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull latest values for every 4 hours time interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608924#M211744</link>
      <description>&lt;P&gt;If you want to align time so that your 4 hours windows are always 0-4, 4-8, 8-12 and so on, then you should use the aligntime parameter to the bin command to align it to the day starting point, otherwise it will bucket the data into 4 hours windows based on the current hour being the last of 4.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=4h aligntime=@d&lt;/LI-CODE&gt;&lt;P&gt;Note that your startTime appears to be text, so you would also need something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval start_time=strptime(StartTime, "%m/%d/%Y %H:%M")
| bin start_time span=4h aligntime=@d&lt;/LI-CODE&gt;&lt;P&gt;Note that I assumed US time above, as the data doesn't say either way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 23:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-latest-values-for-every-4-hours-time-interval/m-p/608924#M211744</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-09T23:49:57Z</dc:date>
    </item>
  </channel>
</rss>

