<?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 next log entry in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607943#M211386</link>
    <description>&lt;P&gt;Do you mean the&amp;nbsp;&lt;SPAN&gt;DHCPREQUEST event in the index in time order, or just the next event in the index by time?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Assuming you mean the latter, if&amp;nbsp;DHCPREQUEST is the latest event, then there won't be a next event (just yet), so you could copy each event to the previous event and then search for&amp;nbsp;DHCPREQUEST in the current events. You could try something like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dhcp
| streamstats window=1 current=f values(_raw) as previous
| regex _raw="DHCPREQUEST"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 15:19:37 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-02T15:19:37Z</dc:date>
    <item>
      <title>How do i search next log entry after the one I originally searched for?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607935#M211383</link>
      <description>&lt;P&gt;I'm very new to splunk.&amp;nbsp; What I'm trying to search for is the next log entry after the entry I search for.&amp;nbsp; For example, I have this log entry from a search:&lt;/P&gt;
&lt;P&gt;search: index=dhcp DHCPREQUEST&lt;/P&gt;
&lt;P&gt;result:&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;8/1/22&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10:00:00.000 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Aug&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;10:00:00&lt;/SPAN&gt; &lt;SPAN class=""&gt;b826c80c7n&lt;/SPAN&gt; &lt;SPAN class=""&gt;dhcpd&lt;/SPAN&gt;[&lt;SPAN class=""&gt;23809&lt;/SPAN&gt;]&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;DHCPREQUEST&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;10.23.1.131&lt;/SPAN&gt; &lt;SPAN class=""&gt;from&lt;/SPAN&gt; &lt;SPAN class=""&gt;00:50:56:9e:82:3e&lt;/SPAN&gt; &lt;SPAN class=""&gt;via&lt;/SPAN&gt; &lt;SPAN class=""&gt;eth0&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class=""&gt;
&lt;UL class=""&gt;
&lt;LI&gt;&lt;SPAN class=""&gt;host =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="nss.wright.edu" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;nss.wright.edu&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;monitor_fast&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class=""&gt;index =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="dhcp" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;dhcp&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class=""&gt;linecount =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="1" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;1&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class=""&gt;source =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="/var/log/clients/130.108.128.199/dhcpd" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;/var/log/clients/130.108.128.199/dhcpd&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class=""&gt;sourcetype =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="isc:dhcp" href="https://splunksh.wright.edu:8000/en-US/app/search/search?q=search%20index%3Ddhcp%20DHCPREQUEST%20%7C%20reverse&amp;amp;display.page.search.mode=fast&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-24h%40h&amp;amp;latest=now&amp;amp;sid=1659450340.107731#" target="_blank" rel="noopener"&gt;isc:dhcp&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm trying to find is the next log entry after this.&amp;nbsp; Any suggestions would help.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607935#M211383</guid>
      <dc:creator>David_M</dc:creator>
      <dc:date>2022-08-02T15:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next log entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607943#M211386</link>
      <description>&lt;P&gt;Do you mean the&amp;nbsp;&lt;SPAN&gt;DHCPREQUEST event in the index in time order, or just the next event in the index by time?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Assuming you mean the latter, if&amp;nbsp;DHCPREQUEST is the latest event, then there won't be a next event (just yet), so you could copy each event to the previous event and then search for&amp;nbsp;DHCPREQUEST in the current events. You could try something like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dhcp
| streamstats window=1 current=f values(_raw) as previous
| regex _raw="DHCPREQUEST"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607943#M211386</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-02T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next log entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607964#M211393</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168" target="_self"&gt;&lt;SPAN class=""&gt;TWhisperer&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Well that didn't quite do it.&amp;nbsp; But after pouring over my DHCP logs and some packet captures I figured out to do what I want is going to require my DHCP server adding the DHCP transaction ID to syslog, if that's possible.&amp;nbsp; Getting the log entries around the target entry still doesn't narrow things down enough.&amp;nbsp; But that you for th suggestion, I'm sure I'll be using it at some point.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 18:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-search-next-log-entry-after-the-one-I-originally/m-p/607964#M211393</guid>
      <dc:creator>David_M</dc:creator>
      <dc:date>2022-08-02T18:59:10Z</dc:date>
    </item>
  </channel>
</rss>

