<?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 compare 2 field different source type in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566697#M197469</link>
    <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I have the VPN log and network log.&lt;BR /&gt;&lt;BR /&gt;- In VPN log's it's possible to show IP and USERNAME&amp;nbsp;&lt;BR /&gt;- In Network log it's possible to show what's site the IP access.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to comparare 2 fields ( IP VPN&amp;nbsp; [src_ip] , IP Network [SRC])&amp;nbsp; if the field is the same i will add the user.&lt;/P&gt;&lt;P&gt;I Tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security host=homolog (sourcetype=vpn_log OR sourcetype=network_log)
| where src_ip=SRC
| eval username_acess=user
| table username_acess,SRC,dst&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But doesnt work.&lt;/P&gt;&lt;P&gt;Another way is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval field1=SRC,field2=src_ip 
| eval results1=if(field1=field2,"Yes","No") 
| eval results2=if(match(field1,field2),"Yes","No")
| where match(field1,field2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the error is&amp;nbsp;because the sourcetype is&amp;nbsp;different.&lt;BR /&gt;&lt;BR /&gt;Could you help me ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 21:55:02 GMT</pubDate>
    <dc:creator>pgabriel10</dc:creator>
    <dc:date>2021-09-10T21:55:02Z</dc:date>
    <item>
      <title>compare 2 field different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566697#M197469</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I have the VPN log and network log.&lt;BR /&gt;&lt;BR /&gt;- In VPN log's it's possible to show IP and USERNAME&amp;nbsp;&lt;BR /&gt;- In Network log it's possible to show what's site the IP access.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to comparare 2 fields ( IP VPN&amp;nbsp; [src_ip] , IP Network [SRC])&amp;nbsp; if the field is the same i will add the user.&lt;/P&gt;&lt;P&gt;I Tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security host=homolog (sourcetype=vpn_log OR sourcetype=network_log)
| where src_ip=SRC
| eval username_acess=user
| table username_acess,SRC,dst&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But doesnt work.&lt;/P&gt;&lt;P&gt;Another way is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval field1=SRC,field2=src_ip 
| eval results1=if(field1=field2,"Yes","No") 
| eval results2=if(match(field1,field2),"Yes","No")
| where match(field1,field2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the error is&amp;nbsp;because the sourcetype is&amp;nbsp;different.&lt;BR /&gt;&lt;BR /&gt;Could you help me ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 21:55:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566697#M197469</guid>
      <dc:creator>pgabriel10</dc:creator>
      <dc:date>2021-09-10T21:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 field different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566699#M197471</link>
      <description>&lt;P&gt;It doesn't work because splunk works on a pipeline of events - your events come from different source types so the fields extracted in one sourcetype may not exist in the other source type. You can rename one of the fields so it has the same name as the other sourcetype and then either join or use stats to collate the information from the different sourcetypes.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security host=homolog (sourcetype=vpn_log OR sourcetype=network_log)
| rename src_ip as SRC
| stats values(user) as username_access values(dst) as dst by SRC
| table username_acess,SRC,dst&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Sep 2021 22:54:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566699#M197471</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-10T22:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 field different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566709#M197476</link>
      <description>&lt;P&gt;I tried but doesnt work. The dst field is blank. Just show the username and SRC.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2021 03:10:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566709#M197476</guid>
      <dc:creator>pgabriel10</dc:creator>
      <dc:date>2021-09-11T03:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 field different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566710#M197477</link>
      <description>&lt;P&gt;The dst field came from your example - if it is not filled, you should look at your extractions&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2021 08:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-2-field-different-source-type/m-p/566710#M197477</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-11T08:25:02Z</dc:date>
    </item>
  </channel>
</rss>

