<?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 find the records based on another search but each happened afterwards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-records-based-on-another-search-but-each/m-p/590111#M205447</link>
    <description>&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=app ((class=ClassA  conditionA=aVal) OR (class=ClassB conditionB=bVal))
| eval time_classA=if((class=ClassA conditionA=aVal), _time, null())
| eval time_classB=if((class=ClassB conditionB=bVal), _time, null())
| stats count, latest(time_classA) as time_classA, latest(time_classB) as time_classB by rid
| where time_classB &amp;gt; time_classA&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps. Kindly accept the solution if it is helpful.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2022 05:50:53 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2022-03-22T05:50:53Z</dc:date>
    <item>
      <title>How to find the records based on another search but each happened afterwards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-records-based-on-another-search-but-each/m-p/590098#M205445</link>
      <description>&lt;P&gt;Hi, I would like to implement some splunk alert to check if there's any special event that happened after a certain event, all the events are grouped by the same request-id,&amp;nbsp; wonder if you could help on this, thanks&lt;/P&gt;&lt;P&gt;queryA -&amp;nbsp; &amp;nbsp;index=app&amp;nbsp; class=ClassA&amp;nbsp; conditionA=aVal | fields&amp;nbsp; rid, _ time | table rid, _time,&amp;nbsp; &amp;nbsp;each result (rid, _time) is unique&lt;/P&gt;&lt;P&gt;queryB -&amp;nbsp; &amp;nbsp;index=app&amp;nbsp; class=ClassB&amp;nbsp;conditionB=bVal&amp;nbsp; &amp;nbsp;rid=queryA.rid and _time &amp;gt;&amp;nbsp;queryA._time&lt;/P&gt;&lt;P&gt;I would like to get the alert if queryB has a result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it is represented as a SQL, it would be like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;select&amp;nbsp; field1, fiedl2 ....&amp;nbsp; from queryB as B,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(select id, _time from queryA where&amp;nbsp; afield1=someval and afield2=val2) as A&lt;BR /&gt;where B.id=A.id and B._time &amp;gt; A._time&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated, thanks&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 04:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-records-based-on-another-search-but-each/m-p/590098#M205445</guid>
      <dc:creator>shancao</dc:creator>
      <dc:date>2022-03-22T04:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the records based on another search but each happened afterwards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-records-based-on-another-search-but-each/m-p/590111#M205447</link>
      <description>&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=app ((class=ClassA  conditionA=aVal) OR (class=ClassB conditionB=bVal))
| eval time_classA=if((class=ClassA conditionA=aVal), _time, null())
| eval time_classB=if((class=ClassB conditionB=bVal), _time, null())
| stats count, latest(time_classA) as time_classA, latest(time_classB) as time_classB by rid
| where time_classB &amp;gt; time_classA&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps. Kindly accept the solution if it is helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 05:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-records-based-on-another-search-but-each/m-p/590111#M205447</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-03-22T05:50:53Z</dc:date>
    </item>
  </channel>
</rss>

