<?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: ideas for reliably bracketing timerange around discrete 'snapshots' in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42693#M9991</link>
    <description>&lt;P&gt;Your best bet is to use the "head" command which can take a predicate instead of an absolute count.&lt;/P&gt;

&lt;P&gt;For example, the following search only takes (all of) the events from the most recent second from index=_internal:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | streamstats dc(_time) as dc_time | head dc_time==1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Jul 2011 12:50:40 GMT</pubDate>
    <dc:creator>Stephen_Sorkin</dc:creator>
    <dc:date>2011-07-14T12:50:40Z</dc:date>
    <item>
      <title>ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42692#M9990</link>
      <description>&lt;P&gt;Say that you have a huge volume of events, and they come in big batches.  Each batch is a discrete unit, and mixing information from the most recent batch with the previous batch is unacceptable. &lt;/P&gt;

&lt;P&gt;more givens: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;the events within a particular batch are spread out over a few minutes. &lt;/LI&gt;
&lt;LI&gt;we do have control over the data so we could write a particular event at the start and at the end of the batch if necessary.  We could even create a start/end event that had a different source or sourcetype. &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Given all this, Is there a good clean way to construct a custom search or a custom view that will be sure to operate only on the events of the most recent batch?  &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2011 04:32:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42692#M9990</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-07-14T04:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42693#M9991</link>
      <description>&lt;P&gt;Your best bet is to use the "head" command which can take a predicate instead of an absolute count.&lt;/P&gt;

&lt;P&gt;For example, the following search only takes (all of) the events from the most recent second from index=_internal:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | streamstats dc(_time) as dc_time | head dc_time==1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jul 2011 12:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42693#M9991</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-07-14T12:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42694#M9992</link>
      <description>&lt;P&gt;The events here are not in a single second, but this offers a tool that seems to open up a number of other ideas.  Is that ability of the head command new in 4.2?  It seems like I could use eval and streamstats to keep track of when I see the 'start' event and 'end' event, and then use head to terminate once I get back to the correct head event. Is that what you would do?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2011 17:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42694#M9992</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-07-14T17:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42695#M9993</link>
      <description>&lt;P&gt;Wouldn't this be a good use of a transaction command?  especially if you've got a well defined start and stop?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2011 17:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42695#M9993</guid>
      <dc:creator>Brian_Osburn</dc:creator>
      <dc:date>2011-07-14T17:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42696#M9994</link>
      <description>&lt;P&gt;transaction wont work here because the set of events needs to be sliced and diced up a number of ways by a lot of different 'stats foo(bar) by baz, bat' searches, and transaction is going to put me in multivalue hell.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2011 19:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42696#M9994</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-07-14T19:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: ideas for reliably bracketing timerange around discrete 'snapshots'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42697#M9995</link>
      <description>&lt;P&gt;This ability of head has been around since 4.1, I believe.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2011 01:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ideas-for-reliably-bracketing-timerange-around-discrete/m-p/42697#M9995</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-07-16T01:45:49Z</dc:date>
    </item>
  </channel>
</rss>

