<?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: Finding x number of log entries that happened prior to search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158870#M44800</link>
    <description>&lt;P&gt;Please vote up both answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 14:18:42 GMT</pubDate>
    <dc:creator>markthompson</dc:creator>
    <dc:date>2015-02-24T14:18:42Z</dc:date>
    <item>
      <title>Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158863#M44793</link>
      <description>&lt;P&gt;I'm looking to find the last 5 log entries that occurred before a certain event, but I don't know how to craft the search.&lt;/P&gt;

&lt;P&gt;My initial search will be something like &lt;CODE&gt;sourcetype="syslog" DUPLEX_MISMATCH&lt;/CODE&gt;,  but then based on those events, I'd like to see the five syslog events (sourcetype=syslog OR sourcetype=tacacs) that happened directly  before the &lt;CODE&gt;DUPLEX_MISMATCH&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;If my normal search would return 5 results. I'd like to see all of those 5, plus the 5 before each of them, for a total of 30.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 13:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158863#M44793</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2015-02-24T13:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158864#M44794</link>
      <description>&lt;P&gt;There are many ways to look at this, but one that sprung to my mind was to use transaction, which may sound strange but hear me out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
If you do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction endswith="DUPLEX_MISMATCH" maxevents=6 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would group them all into events with the 5 events prior to that statement.&lt;/P&gt;

&lt;P&gt;It's just a thought, I'm sure there are many other ways to do it, but I think it'd do the trick.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158864#M44794</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158865#M44795</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;You can get this usign the transaction command, with something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=syslog OR sourcetype=tacacs) | transaction endswith="DUPLEX_MISMATCH" maxevents=5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create transactions whose last event match DUPLEX_MISMATCH and groups a total of 5 events&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:06:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158865#M44795</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2015-02-24T14:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158866#M44796</link>
      <description>&lt;P&gt;Isn't that what I posted?&lt;BR /&gt;
But it would need to be 6, because it picks up the last statement, and he wants the prior 5.  &lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158866#M44796</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158867#M44797</link>
      <description>&lt;P&gt;Please accept answer &amp;amp; vote up if it worked for you ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158867#M44797</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158868#M44798</link>
      <description>&lt;P&gt;You're both right. Thanks so much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158868#M44798</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2015-02-24T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158869#M44799</link>
      <description>&lt;P&gt;@sanorthrup&lt;BR /&gt;
This answer wouldn't do what you need,  the maxevents would be 6 as the ending statement is classed as an event itself.  Hence my answer, which was posted at pretty much the same time &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Infact i think mine was a bit quicker &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:17:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158869#M44799</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158870#M44800</link>
      <description>&lt;P&gt;Please vote up both answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158870#M44800</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158871#M44801</link>
      <description>&lt;P&gt;I gave you all my "reputation points" so now I can't vote anything up anymore.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158871#M44801</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2015-02-24T14:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Finding x number of log entries that happened prior to search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158872#M44802</link>
      <description>&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;   Glad we could help you achieve your solution, and quickly as well!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 14:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-x-number-of-log-entries-that-happened-prior-to-search/m-p/158872#M44802</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-02-24T14:26:49Z</dc:date>
    </item>
  </channel>
</rss>

