<?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: Correlation 2 sourcetype with common fields different name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406186#M172846</link>
    <description>&lt;P&gt;Sorry for the mistake. I test again and work. I forget the rename the field.&lt;/P&gt;

&lt;P&gt;Thanks man.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 17:31:16 GMT</pubDate>
    <dc:creator>pgbr7</dc:creator>
    <dc:date>2019-02-27T17:31:16Z</dc:date>
    <item>
      <title>Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406178#M172838</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;

&lt;P&gt;I have 2 sourcetype, the sourcetype A have the fields [ IP , hostname , source_mac ] , the sourcetype B have the fields [ Username , mac_addres ]&lt;BR /&gt;
I need a correlation the sourcetype A source_mac with sourcetype B mac_addres, because it's the same MAC. &lt;BR /&gt;
Return table with fields [ Username , mac_addres, IP ,hostname ]&lt;/P&gt;

&lt;P&gt;I'm trying this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=main (sourcetype=A) &lt;BR /&gt;
| fields IP , hostname , source_mac &lt;BR /&gt;
| dedup IP , hostname , source_mac&lt;BR /&gt;
| append &lt;BR /&gt;
    [ search sourcetype="B" &lt;BR /&gt;
    | dedup mac_addres&lt;BR /&gt;
    | fields mac_addres, Username&lt;BR /&gt;
    | eval Match=coalesce(source_mac, mac_addres)&lt;BR /&gt;
    | table Match,IP , hostname , Username&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;But don't work, return the sourcetype=A and sourcetype=B. &lt;/P&gt;

&lt;P&gt;Any suggestion ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406178#M172838</guid>
      <dc:creator>pgbr7</dc:creator>
      <dc:date>2020-09-29T23:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406179#M172839</link>
      <description>&lt;P&gt;You would need to use join as mentioned by another splunker.&lt;/P&gt;

&lt;P&gt;|makresults |eval sourcetype="A", IP="1.2.3.4", src_mac="abcd", host="host1"&lt;BR /&gt;
|join src_mac [|makeresults | eval sourcetype="B", user="usr1", mac_address="abcd" | rename mac_address AS src_mac]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:25:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406179#M172839</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2020-09-29T23:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406180#M172840</link>
      <description>&lt;P&gt;try this if you are ok with using join &lt;/P&gt;

&lt;P&gt;index=main (sourcetype=A)&lt;BR /&gt;
| fields IP , hostname , source_mac&lt;BR /&gt;
| dedup IP , hostname , source_mac&lt;BR /&gt;
| join source_mac&lt;BR /&gt;
[ search sourcetype="B"&lt;BR /&gt;
| dedup mac_addres&lt;BR /&gt;
| rename mac_addess as source_mac&lt;BR /&gt;
| fields source_mac, Username]&lt;BR /&gt;
| table Match,IP , hostname , Username&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406180#M172840</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406181#M172841</link>
      <description>&lt;P&gt;In this case,  In sourcetype"B" I have mac_addres, but in sourcetype="A"  I don´t have . So I need &lt;BR /&gt;
compare fields ( mac_addres and source_mac , If the Source_mac have the same mac_addres, i return  the fields Sourcetype A (  IP , hostname ) and  sourcetype B ( Username ) in the same table.&lt;/P&gt;

&lt;P&gt;index=main (sourcetype=A)&lt;BR /&gt;
| fields IP , hostname , source_mac&lt;BR /&gt;
| dedup IP , hostname , source_mac&lt;BR /&gt;
| join source_mac&lt;BR /&gt;
[ search sourcetype="B"&lt;BR /&gt;
| dedup mac_addres&lt;BR /&gt;
| rename mac_addess as source_mac&lt;BR /&gt;
| fields source_mac, Username]&lt;BR /&gt;
| table Match,IP , hostname , Username&lt;/P&gt;

&lt;P&gt;In this case:&lt;BR /&gt;
 index=main (sourcetype=A OR sourcetype=B) &lt;BR /&gt;
 | fields IP , hostname , source_mac , mac_address, Username&lt;BR /&gt;
 | search (mac_address == source_mac)&lt;BR /&gt;
 |table IP, hostname, source_mac, Username&lt;/P&gt;

&lt;P&gt;Don´t work.&lt;/P&gt;

&lt;P&gt;Thanks guys.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406181#M172841</guid>
      <dc:creator>pgbr7</dc:creator>
      <dc:date>2020-09-29T23:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406182#M172842</link>
      <description>&lt;P&gt;Don´t work, Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 14:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406182#M172842</guid>
      <dc:creator>pgbr7</dc:creator>
      <dc:date>2019-02-25T14:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406183#M172843</link>
      <description>&lt;P&gt;The entries for each sourcetype would come in their own rows in the results, so doing &lt;CODE&gt;search (mac_address == source_mac)&lt;/CODE&gt; will never work. Also &lt;CODE&gt;search&lt;/CODE&gt; cannot be used to compare fields, you need to use &lt;CODE&gt;where&lt;/CODE&gt; for that.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 14:20:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406183#M172843</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-25T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406184#M172844</link>
      <description>&lt;P&gt;Thx FrankVI&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 14:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406184#M172844</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-25T14:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406185#M172845</link>
      <description>&lt;P&gt;As you don't have source_mac in both source types, we are renaming mac_address in source type B to source_mac to facilitate join with source type A. Not sure why it didn't work. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406185#M172845</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation 2 sourcetype with common fields different name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406186#M172846</link>
      <description>&lt;P&gt;Sorry for the mistake. I test again and work. I forget the rename the field.&lt;/P&gt;

&lt;P&gt;Thanks man.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 17:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correlation-2-sourcetype-with-common-fields-different-name/m-p/406186#M172846</guid>
      <dc:creator>pgbr7</dc:creator>
      <dc:date>2019-02-27T17:31:16Z</dc:date>
    </item>
  </channel>
</rss>

