<?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: Matching events with same values across different fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572249#M199444</link>
    <description>&lt;P&gt;If this isn't sufficient&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where source_port&amp;gt;destination_port&lt;/LI-CODE&gt;&lt;P&gt;try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="source_ip                   source_port                    destination_ip                  destination_port
1.1.1.1                        42000                                  2.2.2.2                                     80
2.2.2.2                        80                                         1.1.1.1                                       42000
1.1.1.5                       42300                                  2.2.2.2                                      80
3.3.3.3                       134                                       5.5.5.5                                      80"
| multikv forceheader=1
| table source_ip                   source_port                    destination_ip                  destination_port
| eval highport=if(source_port&amp;gt;destination_port,source_ip.":".source_port.",".destination_ip.":".destination_port,destination_ip.":".destination_port.",".source_ip.":".source_port)
| eventstats count by highport
| where count=1 OR highport=source_ip.":".source_port.",".destination_ip.":".destination_port&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 25 Oct 2021 11:50:54 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-10-25T11:50:54Z</dc:date>
    <item>
      <title>Matching events with same values across different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572239#M199440</link>
      <description>&lt;P&gt;HI All&lt;/P&gt;&lt;P&gt;I have IP flow based information being ingested into Splunk, which consists of source_ip, source_port, destination_ip, destination_port.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Occasionally, due to the environmental factors, we get a duplicate log of the flow in the reverse direction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;source_ip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;source_port&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destination_ip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destination_port&lt;/P&gt;&lt;P&gt;1.1.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.2.2.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;- &amp;nbsp;Keep this&lt;/P&gt;&lt;P&gt;2.2.2.2.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.1.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;- I would like to discard this&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.1.1.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42300&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.2.2.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&lt;/P&gt;&lt;P&gt;3.3.3.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;134&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.5.5.5.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80 &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to identify and ultimately filter out the duplicated entries.&lt;/P&gt;&lt;P&gt;What I am having trouble with is coming up with a query to flag events where there is a duplicate entry (in reverse direction).&lt;/P&gt;&lt;P&gt;I can then filter out the “flagged” duplicate entries where say source_port &amp;lt; destination_port.&lt;/P&gt;&lt;P&gt;I am trying to avoid using computational heavy commands such as nested searches as the data set is quite large.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would greatly appreciate some ideas or assistance on how this can be tackled.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572239#M199440</guid>
      <dc:creator>devak</dc:creator>
      <dc:date>2021-10-25T10:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Matching events with same values across different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572249#M199444</link>
      <description>&lt;P&gt;If this isn't sufficient&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where source_port&amp;gt;destination_port&lt;/LI-CODE&gt;&lt;P&gt;try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="source_ip                   source_port                    destination_ip                  destination_port
1.1.1.1                        42000                                  2.2.2.2                                     80
2.2.2.2                        80                                         1.1.1.1                                       42000
1.1.1.5                       42300                                  2.2.2.2                                      80
3.3.3.3                       134                                       5.5.5.5                                      80"
| multikv forceheader=1
| table source_ip                   source_port                    destination_ip                  destination_port
| eval highport=if(source_port&amp;gt;destination_port,source_ip.":".source_port.",".destination_ip.":".destination_port,destination_ip.":".destination_port.",".source_ip.":".source_port)
| eventstats count by highport
| where count=1 OR highport=source_ip.":".source_port.",".destination_ip.":".destination_port&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Oct 2021 11:50:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572249#M199444</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-25T11:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Matching events with same values across different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572258#M199448</link>
      <description>&lt;P&gt;Thats fantastic, thank you.&amp;nbsp;&lt;BR /&gt;I really like the way you have solved it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:24:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-events-with-same-values-across-different-fields/m-p/572258#M199448</guid>
      <dc:creator>devak</dc:creator>
      <dc:date>2021-10-25T12:24:44Z</dc:date>
    </item>
  </channel>
</rss>

