<?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 Comparing two different fields in separate events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-different-fields-in-separate-events/m-p/622756#M216501</link>
    <description>&lt;P&gt;Hi Splunkers&lt;/P&gt;
&lt;P&gt;I am looking to get some help in spl for following use case&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults count=4
| streamstats count
| eval src=case(count=1, "2.3.5.6", count=2, "3.3.3.3", count=3, "1.1.1.6", count=4, "4.5.6.4")
| eval dest = case(count=1, "4.5.6.4", count=2, "4.5.6.4", count=3, "2.2.2.6", count=4,"2.3.5.6")&lt;/LI-CODE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;I want to get only event1 and event4 . In this case event1 src=dest event4 and event1 dest=src event4. This is only a run anywhere example. In real there will be thousands of events and I want to compare event x src=dest event y&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhupi&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 16:37:28 GMT</pubDate>
    <dc:creator>bhupi</dc:creator>
    <dc:date>2022-12-01T16:37:28Z</dc:date>
    <item>
      <title>Comparing two different fields in separate events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-different-fields-in-separate-events/m-p/622756#M216501</link>
      <description>&lt;P&gt;Hi Splunkers&lt;/P&gt;
&lt;P&gt;I am looking to get some help in spl for following use case&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults count=4
| streamstats count
| eval src=case(count=1, "2.3.5.6", count=2, "3.3.3.3", count=3, "1.1.1.6", count=4, "4.5.6.4")
| eval dest = case(count=1, "4.5.6.4", count=2, "4.5.6.4", count=3, "2.2.2.6", count=4,"2.3.5.6")&lt;/LI-CODE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;I want to get only event1 and event4 . In this case event1 src=dest event4 and event1 dest=src event4. This is only a run anywhere example. In real there will be thousands of events and I want to compare event x src=dest event y&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhupi&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 16:37:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-different-fields-in-separate-events/m-p/622756#M216501</guid>
      <dc:creator>bhupi</dc:creator>
      <dc:date>2022-12-01T16:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: comparing two different fields in separate events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-different-fields-in-separate-events/m-p/622769#M216509</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251799"&gt;@bhupi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have some problem to figure your real need, anyway, you should define the rule to choose event x and event y and assign the src and dest values when these events occur, in other words you should&amp;lt;your_search&amp;gt; | eval check=case(event=x,"src",event=y,dest) | stats values(check) AS check dc(check) AS check_count BY key.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 08:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-different-fields-in-separate-events/m-p/622769#M216509</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-01T08:45:20Z</dc:date>
    </item>
  </channel>
</rss>

