<?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 join fields that have different values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483587#M135396</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="indexA" AND sourcetype="sourcetypeA" AND FileName=Test.json)
(index="indexB" AND sourcetype="sourcetypeB" AND FileName=Test.json.pgp)
| rex field=FileName mode=sed "s/\.pgp$//"
| stats values(*) AS * BY FileName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Nov 2019 00:24:26 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-15T00:24:26Z</dc:date>
    <item>
      <title>How to join fields that have different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483584#M135393</link>
      <description>&lt;P&gt;I need to join two searches that do not have a common fields.&lt;/P&gt;

&lt;P&gt;First search has a field &lt;STRONG&gt;FileName=Test.json&lt;/STRONG&gt;&lt;BR /&gt;
Second search has field &lt;STRONG&gt;FileName=Test.json.pgp&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;How do I join the two searches?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 18:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483584#M135393</guid>
      <dc:creator>gravi</dc:creator>
      <dc:date>2019-11-14T18:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to join fields that have different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483585#M135394</link>
      <description>&lt;P&gt;what about an OR condition ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  FileName=Test.json OR FileName=Test.json.pgp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you have 2 searches and try to JOIN them, normalize the fields name or content, then use a join&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search1withoutpgp | eval FileName=FileName.".pgp" | join FileName [ search search2withpgp  |  table myotherfield FileName]  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Nov 2019 19:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483585#M135394</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2019-11-14T19:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to join fields that have different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483586#M135395</link>
      <description>&lt;P&gt;Hi Gravi&lt;/P&gt;

&lt;P&gt;Once I had a similar scenario, the first thing that worked for me was evaluated that both fields had the same type of data is "Strings"&lt;BR /&gt;
After validating that, perform the inner join  command  to make the cross and compare the data.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 21:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483586#M135395</guid>
      <dc:creator>edgarsilva01</dc:creator>
      <dc:date>2019-11-14T21:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to join fields that have different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483587#M135396</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="indexA" AND sourcetype="sourcetypeA" AND FileName=Test.json)
(index="indexB" AND sourcetype="sourcetypeB" AND FileName=Test.json.pgp)
| rex field=FileName mode=sed "s/\.pgp$//"
| stats values(*) AS * BY FileName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Nov 2019 00:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483587#M135396</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-15T00:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to join fields that have different values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483588#M135397</link>
      <description>&lt;P&gt;HJi @gravi,&lt;BR /&gt;
if there's a rule in the values of filename in the second search (e.g. take all but extension), you could use regex to extract them, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index_A
| join FileName [ search index=index_B | rex field=FileName "(?&amp;lt;FileName&amp;gt;.*)\.\w+$" ]
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 08:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-fields-that-have-different-values/m-p/483588#M135397</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-11-15T08:00:43Z</dc:date>
    </item>
  </channel>
</rss>

