<?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: Creating a search to return potentially unrelated events around a key events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11029#M645</link>
    <description>&lt;P&gt;Thanks, we'll have use for this in the near future.  In this use case, the user actually needs to read the interactions between our back office and partners.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2010 13:29:09 GMT</pubDate>
    <dc:creator>msorenson</dc:creator>
    <dc:date>2010-04-16T13:29:09Z</dc:date>
    <item>
      <title>Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11024#M640</link>
      <description>&lt;P&gt;I would like to create a search that is first able to determine when one or more incidents or events have occurred.  Then from that search, I would like to see all other events that have occurred within a specified time range around each of those incidents.&lt;/P&gt;

&lt;P&gt;I'm guessing the search will follow something like this, but I don't have a good idea on how to actually create it:&lt;/P&gt;

&lt;P&gt;search for each [sub search for key expression - returns set of event times] earliest=-5m@m latest=+5m@m | transaction etc...&lt;/P&gt;

&lt;P&gt;Any help or examples would be great!
Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2010 02:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11024#M640</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2010-04-07T02:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11025#M641</link>
      <description>&lt;H2&gt;Check out the "localize" search command.&lt;/H2&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Localize" rel="nofollow"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Localize&lt;/A&gt;&lt;/P&gt;

&lt;H2&gt;Description&lt;/H2&gt;

&lt;P&gt;Generates a list of time contiguous event regions defined as: a period of time in which consecutive events are separated by at most 'maxpause' time. The found regions can be expanded using the 'timeafter' and 'timebefore' modifiers to expand the range after/before the last/first event in the region respectively. The Regions are return in time descending order, just as search results (time of region is start time). The regions discovered by localize are meant to be feed into the map command, which will use a different region for each iteration. Localize also reports: (a) number of events in the range, (b) range duration in seconds and (c) region density defined as (#of events in range) divided by (range duration) - events per second.&lt;/P&gt;

&lt;H2&gt;Examples&lt;/H2&gt;

&lt;P&gt;Example 1: Search the time range of each previous result for "failure".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | localize maxpause=5m | map search="search failure starttimeu=$starttime$ endtimeu=$endtime$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example 2: As an example, searching for "error" and then calling localize finds good regions around where error occurs, and passes each on to the search inside of the the map command, so that each iteration works with a specific timerange to find promising transactions&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;error | localize | map search="search starttimeu::$starttime$ endtimeu::$endtime$ |transaction uid,qid maxspan=1h"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Apr 2010 05:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11025#M641</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2010-04-07T05:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11026#M642</link>
      <description>&lt;P&gt;Here is an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mystuff [ search sourcetype=mystuff "interesting event" | head 1 | eval earliest=_time-5 | eval latest=_time+5 | fields earliest,latest | format "(" "(" "" ")" "OR" ")" ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will find the single most recent &lt;CODE&gt;"interesting event"&lt;/CODE&gt; in the &lt;CODE&gt;myfirst&lt;/CODE&gt; sourcetype, and then display everything for 5 seconds around that in the same sourcetype.&lt;/P&gt;

&lt;P&gt;Comments:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;You don't really need &lt;CODE&gt;head 1&lt;/CODE&gt;, and
this search will work fine without
it. If there are multiple
&lt;CODE&gt;"interesting event"&lt;/CODE&gt;s, you'll get
everything withing 5 seconds of any
of them.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The &lt;CODE&gt;format&lt;/CODE&gt; command is actually a
hack because there's something that I
consider to be a bug in the search
syntax. If I file that and it gets
fixed, you won't need that clause.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 07 Apr 2010 05:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11026#M642</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-07T05:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11027#M643</link>
      <description>&lt;P&gt;Thanks! You're awesome.  I had to think about what that format is doing and a way to have multiple time ranges (within reason).  Below is the search I ended up with.&lt;/P&gt;

&lt;P&gt;[search index=&amp;lt;&amp;gt; source=&lt;EM&gt;&amp;lt;&amp;gt;.&lt;/EM&gt; &lt;KEY&gt; | dedup _raw | transaction source maxspan=5m | eval starttimeu=_time-60 | eval endtimeu=_time+300 | fields index,source,starttimeu,endtimeu | format "(" "(" "" ")" "OR" ")"] | dedup _raw | transaction source startswith="&amp;lt;&amp;gt;" maxspan=5m | search &lt;KEY&gt; | reverse&lt;/KEY&gt;&lt;/KEY&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11027#M643</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2020-09-28T09:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11028#M644</link>
      <description>&lt;P&gt;I tried to be greedy by not stating the source, but the search then seemed to ignore the OR'd time ranges. The inner search was still just as quick because of the &lt;KEY&gt;, but the outter appeared to scan the entire universe for that entire day.&lt;/KEY&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2010 13:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11028#M644</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2010-04-16T13:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11029#M645</link>
      <description>&lt;P&gt;Thanks, we'll have use for this in the near future.  In this use case, the user actually needs to read the interactions between our back office and partners.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2010 13:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11029#M645</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2010-04-16T13:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a search to return potentially unrelated events around a key events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11030#M646</link>
      <description>&lt;P&gt;Simpler:&lt;/P&gt;

&lt;P&gt;sourcetype=mystuff [ search sourcetype=mystuff "interesting event" | eval earliest=_time-5 | eval latest=_time+5 | return earliest latest]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:39:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-search-to-return-potentially-unrelated-events-around/m-p/11030#M646</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2020-09-28T12:39:14Z</dc:date>
    </item>
  </channel>
</rss>

