<?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: Join 2 tables with different rows but same columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/635662#M220846</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251155"&gt;@PeterGian&lt;/a&gt; please let us know if any of the answers provided helped and therefore we can close the topic, or you need more assistance.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 09:28:29 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2023-03-23T09:28:29Z</dc:date>
    <item>
      <title>How to join two tables with different rows but same columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633858#M220149</link>
      <description>&lt;P&gt;Hello amazing community!&lt;/P&gt;
&lt;P&gt;I'm now stuck with a problem that most probably has a really simple solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table that is generated every night with a batch process, I would need to merge the "today" table with the "yesterday" table and see what is different.&lt;/P&gt;
&lt;P&gt;This is an example just to keep things easy:&lt;/P&gt;
&lt;P&gt;Yesterday table:&lt;/P&gt;
&lt;TABLE border="0" width="144" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="72" height="19"&gt;A&lt;/TD&gt;
&lt;TD width="72"&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;B&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;C&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;D&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;E&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;Z&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today Table:&lt;/P&gt;
&lt;TABLE border="0" width="144" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="72" height="19"&gt;A&lt;/TD&gt;
&lt;TD width="72"&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;B&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;C&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;D&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;E&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;F&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected result:&lt;/P&gt;
&lt;TABLE border="0" width="216" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="72" height="19"&gt;A&lt;/TD&gt;
&lt;TD width="72"&gt;Old&lt;/TD&gt;
&lt;TD width="72"&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;B&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;C&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;D&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;E&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;Z&lt;/TD&gt;
&lt;TD&gt;Old&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="19"&gt;F&lt;/TD&gt;
&lt;TD&gt;null&lt;/TD&gt;
&lt;TD&gt;New&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea about how I can achieve this?&lt;BR /&gt;Many thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 14:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633858#M220149</guid>
      <dc:creator>PeterGian</dc:creator>
      <dc:date>2023-03-23T14:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 tables with different rows but same columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633859#M220150</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251155"&gt;@PeterGian&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share your searches?&lt;/P&gt;&lt;P&gt;in the meantime, see the "timewrap" command (&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/TimewrapCommandOverview" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/TimewrapCommandOverview&lt;/A&gt;) that should solve your request.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 09:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633859#M220150</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-09T09:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 tables with different rows but same columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633864#M220152</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251155"&gt;@PeterGian&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Let's say your column names are FieldA and FieldB, in that case your spl could look like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;index=foo sourcetype=bar earliest=-1d@d
| bucket span=1d _time
| eval
    Yesterday = if(relative_time(now(), "@d") &amp;gt; _time, FieldB, null()), ```this is yesterday```
    Today = if(relative_time(now(), "@d") &amp;lt;= _time, FieldB, null()) ```this is today```
| stats values(Yesterday) as Yesterday, values(Today) as Today by FieldA
| fillnull value=NULL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note I have not tested the SPL syntax.&lt;/P&gt;&lt;P&gt;Hope it helps, if not please post more details about your question.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 10:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/633864#M220152</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2023-03-09T10:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join 2 tables with different rows but same columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/635662#M220846</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251155"&gt;@PeterGian&lt;/a&gt; please let us know if any of the answers provided helped and therefore we can close the topic, or you need more assistance.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 09:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-tables-with-different-rows-but-same-columns/m-p/635662#M220846</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2023-03-23T09:28:29Z</dc:date>
    </item>
  </channel>
</rss>

