<?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 sort contiguous  _time into discreet sets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611052#M212480</link>
    <description>&lt;P&gt;Assuming your _time fields are already align or binned to the minute and are in ascending order, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats range(_time) as previous_gap window=2
| reverse
| streamstats range(_time) as next_gap window=2
| where previous_gap != 60 OR next_gap != 60
| streamstats current=f window=1 values(_time) as latest
| where next_gap=60
| reverse
| rename _time as earliest
| fields earliest latest
| fieldformat earliest=strftime(earliest,"%F %T")
| fieldformat latest=strftime(latest,"%F %T")&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 27 Aug 2022 14:38:18 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-27T14:38:18Z</dc:date>
    <item>
      <title>How to sort contiguous  _time into discreet sets?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611048#M212478</link>
      <description>&lt;P&gt;I'm trying to collapse a of data into earliest/lastest by _time,&amp;nbsp; with the time is contiguous.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Such as:&amp;nbsp;&lt;BR /&gt;2022-08-27 07:36:00&lt;BR /&gt;2022-08-27 07:37:00&lt;BR /&gt;2022-08-27 07:38:00&lt;BR /&gt;2022-08-27 07:39:00&lt;BR /&gt;2022-08-27 07:40:00&lt;BR /&gt;2022-08-27 07:44:00&lt;BR /&gt;2022-08-27 07:45:00&lt;BR /&gt;2022-08-27 07:46:00&lt;BR /&gt;2022-08-27 08:31:00&lt;BR /&gt;2022-08-27 08:32:00&lt;BR /&gt;2022-08-27 08:33:00&lt;BR /&gt;2022-08-27 08:34:00&lt;BR /&gt;2022-08-27 08:35:00&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;earliest:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;latest:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;2022-08-27 07:36:00&amp;nbsp; &amp;nbsp;2022-08-27 07:40:00&lt;BR /&gt;2022-08-27 07:44:00&amp;nbsp; &amp;nbsp;2022-08-27 07:46:00&lt;BR /&gt;2022-08-27 08:31:00&amp;nbsp; &amp;nbsp;2022-08-27 08:35:00&lt;/P&gt;
&lt;P&gt;THoughts?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 13:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611048#M212478</guid>
      <dc:creator>timgren</dc:creator>
      <dc:date>2022-08-29T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort contiguous  _time into discreet sets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611052#M212480</link>
      <description>&lt;P&gt;Assuming your _time fields are already align or binned to the minute and are in ascending order, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats range(_time) as previous_gap window=2
| reverse
| streamstats range(_time) as next_gap window=2
| where previous_gap != 60 OR next_gap != 60
| streamstats current=f window=1 values(_time) as latest
| where next_gap=60
| reverse
| rename _time as earliest
| fields earliest latest
| fieldformat earliest=strftime(earliest,"%F %T")
| fieldformat latest=strftime(latest,"%F %T")&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 27 Aug 2022 14:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611052#M212480</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-27T14:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort contiguous  _time into discreet sets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611055#M212482</link>
      <description>&lt;P&gt;Outstanding sir - thank you! I would have never come up with that.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2022 14:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-contiguous-time-into-discreet-sets/m-p/611055#M212482</guid>
      <dc:creator>timgren</dc:creator>
      <dc:date>2022-08-27T14:51:45Z</dc:date>
    </item>
  </channel>
</rss>

