<?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 link two sources with equals fields in each? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177537#M51047</link>
    <description>&lt;P&gt;Perhaps something like this will get you started.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=Source1 OR source=Source2 | rex field="device number" "Inst-(?P&amp;lt;part1&amp;gt;\w\w:\w\w:\w\w)" | rex field="MAC Address" "\w\w:\w\w:\w\w:(?P&amp;lt;part2&amp;gt;\w\w:\w\w:\w\w)" | where part1=part2 | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Aug 2015 21:06:48 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-08-18T21:06:48Z</dc:date>
    <item>
      <title>How to link two sources with equals fields in each?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177536#M51046</link>
      <description>&lt;P&gt;Hey everyone,&lt;BR /&gt;
Here is my problem:&lt;BR /&gt;
I have two sources (Source1 and Source2):&lt;BR /&gt;
 * In source1 I have the field "device number" written like that: "Inst-&lt;STRONG&gt;C6:82:c3&lt;/STRONG&gt;"&lt;BR /&gt;
 * In the second source I have the field "MAC Address" written like that: "9B:DC:DF:&lt;STRONG&gt;C6:82:c3&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;As you can see, the parts in bold are the same. I would like to create a table with this two fields that displays when field1=field2.&lt;BR /&gt;
I don't know how to select  the part in bold and add a condition to create a table.&lt;BR /&gt;
Could you please help me with that?&lt;BR /&gt;
(This will permit me to link these two different sources)&lt;/P&gt;

&lt;P&gt;Thanks in advance ! &lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 20:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177536#M51046</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-08-18T20:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to link two sources with equals fields in each?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177537#M51047</link>
      <description>&lt;P&gt;Perhaps something like this will get you started.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=Source1 OR source=Source2 | rex field="device number" "Inst-(?P&amp;lt;part1&amp;gt;\w\w:\w\w:\w\w)" | rex field="MAC Address" "\w\w:\w\w:\w\w:(?P&amp;lt;part2&amp;gt;\w\w:\w\w:\w\w)" | where part1=part2 | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Aug 2015 21:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177537#M51047</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-18T21:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to link two sources with equals fields in each?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177538#M51048</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=source1 OR source=source2 | table "Device Number" "Mac Address" | eval commonfield=replace(coalesce('Device Number','Mac Address'),"(.*)(\w\w:\w\w:\w\w)$","\2") | stats values(*) as * by commonfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Aug 2015 21:52:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177538#M51048</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-18T21:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to link two sources with equals fields in each?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177539#M51049</link>
      <description>&lt;P&gt;Try this:&lt;BR /&gt;
&lt;PRE&gt;source=source1 | eval common_part = replace("device number", "^Inst-(\w\w:\w\w:\w\w)$", "\1") | join common_part [source=source2 |eval common_part = replace("Mac Address", "\w\w:\w\w:\w\w:(\w\w:\w\w:\w\w)$", "\1")]&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-link-two-sources-with-equals-fields-in-each/m-p/177539#M51049</guid>
      <dc:creator>chanmi2</dc:creator>
      <dc:date>2020-09-29T07:03:16Z</dc:date>
    </item>
  </channel>
</rss>

