<?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 compare fields from two different event types in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38856#M178744</link>
    <description>&lt;P&gt;It sounds like you're trying to do an intersection of the following 2 searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(1)  sourcetype=firewall (type=traffic AND status!=deny)
(2)  sourcetype=firewall (type=emailfilter AND blacklist)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that's true, then you can use &lt;CODE&gt;stats&lt;/CODE&gt; to identify a field value for &lt;CODE&gt;src&lt;/CODE&gt; that appears in both searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=firewall (type=traffic AND status!=deny) OR (type=emailfilter AND blacklist) | stats count dc(type) as type_count by src | where type_count &amp;gt; 1 | sort count desc | head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search assumes that the two searches actually produce mutually exclusive sets.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2011 00:18:45 GMT</pubDate>
    <dc:creator>Johnvey</dc:creator>
    <dc:date>2011-07-07T00:18:45Z</dc:date>
    <item>
      <title>How to compare fields from two different event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38855#M178743</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to come up with a search to compare the IP address values from two different log types contained in the same sourcetype. i.e. sourcetype=firewall (type=traffic AND status!=deny) Grab src and compare to src in (type=emailfilter AND blacklist)&lt;/P&gt;

&lt;P&gt;I would then chart values that aren't denied in traffic but are blacklisted in a table showing the top 10.&lt;/P&gt;

&lt;P&gt;How/is it possible to compare the src field in the traffic log to the src field in the email log if the above conditions are true?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2011 21:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38855#M178743</guid>
      <dc:creator>corwinz6</dc:creator>
      <dc:date>2011-07-06T21:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare fields from two different event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38856#M178744</link>
      <description>&lt;P&gt;It sounds like you're trying to do an intersection of the following 2 searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(1)  sourcetype=firewall (type=traffic AND status!=deny)
(2)  sourcetype=firewall (type=emailfilter AND blacklist)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that's true, then you can use &lt;CODE&gt;stats&lt;/CODE&gt; to identify a field value for &lt;CODE&gt;src&lt;/CODE&gt; that appears in both searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=firewall (type=traffic AND status!=deny) OR (type=emailfilter AND blacklist) | stats count dc(type) as type_count by src | where type_count &amp;gt; 1 | sort count desc | head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search assumes that the two searches actually produce mutually exclusive sets.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2011 00:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38856#M178744</guid>
      <dc:creator>Johnvey</dc:creator>
      <dc:date>2011-07-07T00:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare fields from two different event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38857#M178745</link>
      <description>&lt;P&gt;Thanks, that looks to be working great. What prevents it from incrementing type_count when more than one event gets generated for (type=traffic AND status!=deny)with the same src value but no (type=emailfilter AND blacklist)?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2011 16:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-fields-from-two-different-event-types/m-p/38857#M178745</guid>
      <dc:creator>corwinz6</dc:creator>
      <dc:date>2011-07-07T16:21:34Z</dc:date>
    </item>
  </channel>
</rss>

