<?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: Merging data from 2 different sourcetypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593412#M206542</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe, Thank you for responding.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;Verified there are no blank spaces.&amp;nbsp; &amp;nbsp;Even if there were null values for some user records,&amp;nbsp; &amp;nbsp;the other query i tried that has |where clause ,&amp;nbsp; as in&amp;nbsp;&lt;STRONG&gt;|where email = user_email&lt;/STRONG&gt;&amp;nbsp;, should work or show some matches&amp;nbsp; &amp;nbsp;but even that one shows&amp;nbsp; "No results found".&lt;BR /&gt;&lt;BR /&gt;Out of curiosity even if i run just this one liner as shown below ,&amp;nbsp; it displays&amp;nbsp; fields (under Interesting Fields) only from 1st sourcetype s1.&amp;nbsp; Nothing from S2 is visible.&amp;nbsp; I guess that's why both coalesce and |where clause are not working for me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xx (sourcetype=s1 OR sourcetype=s2 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 07:50:17 GMT</pubDate>
    <dc:creator>neerajs_81</dc:creator>
    <dc:date>2022-04-12T07:50:17Z</dc:date>
    <item>
      <title>Merging data from 2 different sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593406#M206538</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two sourcetypes in the same index, however the fields names are different but the value is same for the Email address of a user .&amp;nbsp; &amp;nbsp;But yet when i do a coalesce or use |where clause,&amp;nbsp; splunk shows "No results found"&lt;BR /&gt;&amp;nbsp;For example:&lt;BR /&gt;Sourcetype s1 contains email field while s2 contains user_email field.&lt;BR /&gt;Both fields have same value:&amp;nbsp; john_smith@domain.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xx (sourcetype=s1 OR sourcetype=s2) (email=* OR user_email=*)
| eval user_id = coalesce(email, user_email)

OR 

| index=xx (sourcetype=s1 OR sourcetype=s2) 
| where email=user_email&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Result:&amp;nbsp; No results found.&lt;BR /&gt;&lt;BR /&gt;I am following whatever is&amp;nbsp; mentioned in&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/merge-two-sourcetypes-that-have-the-same-data-but-different/m-p/493244," target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/merge-two-sourcetypes-that-have-the-same-data-but-different/m-p/493244,&lt;/A&gt;&amp;nbsp; but yet in my case it shows 0 Result matches.&lt;BR /&gt;&lt;BR /&gt;Any idea what can be the issue ?&amp;nbsp; Is the&amp;nbsp;@ sign or "." (dot) in the email id creating a problem ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593406#M206538</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-04-12T07:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data from 2 different sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593407#M206539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first check if there something else in your fields (e.g. spaces).&lt;/P&gt;&lt;P&gt;Then try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xx ((sourcetype=s1 email=*) OR (sourcetype=s2 user_email=*))
| eval user_id=coalesce(email,user_email)&lt;/LI-CODE&gt;&lt;P&gt;In addition, put speciat attention if the email field cound have null values, becuase in this case the coalesce doesn't work.&lt;/P&gt;&lt;P&gt;In this case, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xx ((sourcetype=s1 email=*) OR (sourcetype=s2 user_email=*))
| eval user_id=if(email="",user_email,email)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:18:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593407#M206539</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-12T07:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data from 2 different sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593412#M206542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe, Thank you for responding.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;Verified there are no blank spaces.&amp;nbsp; &amp;nbsp;Even if there were null values for some user records,&amp;nbsp; &amp;nbsp;the other query i tried that has |where clause ,&amp;nbsp; as in&amp;nbsp;&lt;STRONG&gt;|where email = user_email&lt;/STRONG&gt;&amp;nbsp;, should work or show some matches&amp;nbsp; &amp;nbsp;but even that one shows&amp;nbsp; "No results found".&lt;BR /&gt;&lt;BR /&gt;Out of curiosity even if i run just this one liner as shown below ,&amp;nbsp; it displays&amp;nbsp; fields (under Interesting Fields) only from 1st sourcetype s1.&amp;nbsp; Nothing from S2 is visible.&amp;nbsp; I guess that's why both coalesce and |where clause are not working for me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xx (sourcetype=s1 OR sourcetype=s2 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593412#M206542</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-04-12T07:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data from 2 different sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593414#M206543</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I don't think that this is the issue.&lt;/P&gt;&lt;P&gt;please try to extract the second file (user_email) using the rex command, maybe there's a problem in field extraction.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 08:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-data-from-2-different-sourcetypes/m-p/593414#M206543</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-12T08:02:10Z</dc:date>
    </item>
  </channel>
</rss>

