<?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 create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212976#M62417</link>
    <description>&lt;P&gt;excellent point, because the chances of multiple events occurring at exactly the same is very low&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2016 22:13:23 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-04-27T22:13:23Z</dc:date>
    <item>
      <title>Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212971#M62412</link>
      <description>&lt;P&gt;I have 2 sourcetype sourcetype="pan:traffic" and sourcetype="pan:threat"&lt;/P&gt;

&lt;P&gt;I want to write a splunk query to find events from sourcetype="pan:traffic" where session_end_reason="threat" and get the src_ip from there and then match it with dest_ip in sourcetype="pan:threat" &lt;/P&gt;

&lt;P&gt;here are my logs - &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;sourcetype="pan:threat"  - my dest_ip is 1.1.2.2 and my src_ip value is 46.30.46.196 and GrmBL2Lnhwx.dll is the filename of the executable that user requested for download&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&amp;lt;13&amp;gt;Apr 12 08:17:02 UDC-5060.gadm : 1,2016/04/12 08:17:01,0008C100946,THREAT,file,1,2016/04/12 08:17:01,&lt;STRONG&gt;46.30.46.196,1.1.2.2&lt;/STRONG&gt;,0.0.0.0,0.0.0.0,URL_Global_Unknown_Continue-EXE,,,flash,vsys1,Untrust,Trust,ethernet1/24,ethernet1/23,Panorama-Logging,2016/04/12 08:17:01,34250303,1,80,65077,0,0,0x0,tcp,forward,"&lt;STRONG&gt;GrmBL2Lnhwx.dll&lt;/STRONG&gt;",Microsoft PE File(52060),any,low,server-to-client,18489594034,0x0,RU,US,0,,0,,,3,,,,,,,,0&lt;/P&gt;

&lt;P&gt;Now our firewall is configured such that when a user is initiating an executable download it will bring up a splash screen asking user if they are sure file is safe and want to continue. If they hit continue then session_end_reason has value of "threat" in sourcetype="pan:traffic" logs. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Log from  sourcetype="pan:traffic"  and now my src_ip is 1.1.2.2 and dest_ip is 46.30.46.196 so the values got swapped&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&amp;lt;14&amp;gt;Apr 12 08:18:29 UDC-5060.gadm : 1,2016/04/12 08:18:29,0008C100946,TRAFFIC,end,1,2016/04/12 08:18:29,&lt;STRONG&gt;1.1.2.2&lt;/STRONG&gt;,&lt;STRONG&gt;46.30.46.196&lt;/STRONG&gt;,0.0.0.0,0.0.0.0,URL_Global_Unknown_Continue-EXE,,,flash,vsys1,Trust,Untrust,ethernet1/23,ethernet1/24,Panorama-Logging,2016/04/12 08:18:29,34250303,1,65077,80,0,0,0xf,tcp,allow,85026,2496,82530,84,2016/04/12 08:12:11,96,business-and-economy,0,128310938069,0x0,US,RU,0,24,60,&lt;STRONG&gt;threat&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;i want to find out the IP address of users who were prompted with a splash screen and decided to click continue . Here is the query I have written it is returning results but they are not exactly accurate. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;sourcetype="pan:traffic" session_end_reason="threat" |  join src_ip  [search sourcetype="pan:threat" | rename dest_ip as src_ip ] | table _time,dest_ip,dest_location,src_ip,src_location,filename&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Appreciate your help !&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212971#M62412</guid>
      <dc:creator>dmenon84</dc:creator>
      <dc:date>2020-09-29T09:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212972#M62413</link>
      <description>&lt;P&gt;This might be better. It will certainly be faster&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype="pan:traffic" session_end_reason="threat") OR sourcetype="pan:threat"
| eval match_ip = if(sourcetype=="pan:traffic",src_ip,dest_ip)
| stats list(dest_ip) list(dest_location) list(src_ip) list(src_location) list(filename) by match_ip _time sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Apr 2016 00:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212972#M62413</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-04-23T00:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212973#M62414</link>
      <description>&lt;P&gt;It feels to me as if you should drop &lt;CODE&gt;_time sourcetype&lt;/CODE&gt; from the list of group by fields, else no matches are ever going to be grouped together.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 13:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212973#M62414</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-23T13:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212974#M62415</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;This search giving me lots of false positives, for example sourcetype="pan:traffic" session_end_reason="threat"  returns only 15 events from say 8:00 AM - 9:00 AM today but the entire search returns 1000+ events including the case where session_end_reason!="threat" &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212974#M62415</guid>
      <dc:creator>dmenon84</dc:creator>
      <dc:date>2020-09-29T09:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212975#M62416</link>
      <description>&lt;P&gt;The search should look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  (sourcetype="pan:traffic" session_end_reason="threat") OR sourcetype="pan:threat"
| eval match_ip = if(sourcetype=="pan:traffic",src_ip,dest_ip)
| eval match_location = if(sourcetype=="pan:traffic",src_location,dest_location)
| eval other_ip = if(sourcetype=="pan:traffic",dest_ip,src_ip)
| eval other_location = if(sourcetype=="pan:traffic",dest_location,src_location)
| stats min(_time) as _time list(match_location) as match_location list(other_ip) as other_ip list(other_location) as other_location list(filename) list(sourcetype) as sourcetype by match_ip
| search sourcetype="pan:traffic" sourcetype="pan:threat"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That last bit is key, throw out things from only one sourcetype - non-matches.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 21:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212975#M62416</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-25T21:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create a table to include fields from 2 different sourcetypes where values of field1 from sourcetype 1 is equal to field2 from sourcetype 2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212976#M62417</link>
      <description>&lt;P&gt;excellent point, because the chances of multiple events occurring at exactly the same is very low&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 22:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-to-create-a-table-to-include-fields-from-2-different/m-p/212976#M62417</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-04-27T22:13:23Z</dc:date>
    </item>
  </channel>
</rss>

