<?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: Query to find records in different events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692625#M235733</link>
    <description>&lt;P&gt;Thanks Giuseppe for your quick reply. It doesn't seem to work.&lt;/P&gt;&lt;P&gt;So e.g. there are 6 records,&lt;/P&gt;&lt;P&gt;Name;Reference,Status;Date;Creator;NewReference;Type&lt;/P&gt;&lt;P&gt;Test;Abc1;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Null;OPEN;2022-09-09;Me;Abc1;UPD&lt;/P&gt;&lt;P&gt;Test;Abc2;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Null;OPEN;2022-09-09;Me;Abc2;UPD&lt;/P&gt;&lt;P&gt;Test;Abc3;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Abc5;OPEN;2022-09-09;Me;Abc4;UPD&lt;/P&gt;&lt;P&gt;So in above example, I would like to find records where reference with status DONE is not found in any other record under field New Reference with status OPEN.&lt;/P&gt;&lt;P&gt;In abov example, abc1 and abc2 finds matched record but Abc3 &amp;amp;Abc5 doesn't find.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 11:04:17 GMT</pubDate>
    <dc:creator>mendi</dc:creator>
    <dc:date>2024-07-08T11:04:17Z</dc:date>
    <item>
      <title>Query to find records in different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692622#M235731</link>
      <description>&lt;P&gt;I have thousands of records (events), I would like to search field a if it exists in field b of other event (record).&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;Name;Reference,Status;Date;Creator;NewReference;Type&lt;/P&gt;&lt;P&gt;Test;Abc1;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Null;OPEN;2022-09-09;Me;Abc1;UPD&lt;/P&gt;&lt;P&gt;So I would like to find&amp;nbsp; records where Reference(Abc1) with status (Done) is present&amp;nbsp; in another record whose NewReference is equal to Referenc eof earlier record (Abc1) and status is OPEN&lt;/P&gt;&lt;P&gt;The logs will have thousands of records&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 10:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692622#M235731</guid>
      <dc:creator>mendi</dc:creator>
      <dc:date>2024-07-08T10:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query to find records in different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692623#M235732</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269713"&gt;@mendi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;let me understand: do you have Reference and NewReference in each event?&lt;/P&gt;&lt;P&gt;if yes you have to create a search using the field to compare as keys, something ike this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
[ search &amp;lt;your_search&amp;gt; | rename Reference AS NewReference | fields NewReference ]
| fields Name Reference Status Date Creator NewReference Type
| stats
     dc(Status) AS Status_count
     values(*) AS *
     BY Reference
| where Status_count=2
| table Name Reference Status Date Creator NewReference Type&lt;/LI-CODE&gt;&lt;P&gt;if you have more conditions, you can add them to the where.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 10:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692623#M235732</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-08T10:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Query to find records in different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692625#M235733</link>
      <description>&lt;P&gt;Thanks Giuseppe for your quick reply. It doesn't seem to work.&lt;/P&gt;&lt;P&gt;So e.g. there are 6 records,&lt;/P&gt;&lt;P&gt;Name;Reference,Status;Date;Creator;NewReference;Type&lt;/P&gt;&lt;P&gt;Test;Abc1;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Null;OPEN;2022-09-09;Me;Abc1;UPD&lt;/P&gt;&lt;P&gt;Test;Abc2;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Null;OPEN;2022-09-09;Me;Abc2;UPD&lt;/P&gt;&lt;P&gt;Test;Abc3;DONE;2022-09-09;Me;Null;INS&lt;/P&gt;&lt;P&gt;Hello;Abc5;OPEN;2022-09-09;Me;Abc4;UPD&lt;/P&gt;&lt;P&gt;So in above example, I would like to find records where reference with status DONE is not found in any other record under field New Reference with status OPEN.&lt;/P&gt;&lt;P&gt;In abov example, abc1 and abc2 finds matched record but Abc3 &amp;amp;Abc5 doesn't find.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 11:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692625#M235733</guid>
      <dc:creator>mendi</dc:creator>
      <dc:date>2024-07-08T11:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Query to find records in different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692638#M235736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269713"&gt;@mendi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;ok, it's a different condition:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval key=if(Status="DONE",Reference,NewReference)
| fields Name Reference Status Date Creator NewReference Type
| stats
     dc(Status) AS Status_count
     count(Status) AS Status
     values(*) AS *
     BY key
| where Status_count=1 AND Status="DONE"
| table Name Reference Status Date Creator NewReference Type&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 12:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-find-records-in-different-events/m-p/692638#M235736</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-08T12:30:06Z</dc:date>
    </item>
  </channel>
</rss>

