<?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: Merge two query resultsets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602303#M209644</link>
    <description>&lt;P&gt;You may try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (search1 terms OR search2 terms) |table App,Size,Count|addcoltotals&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_search.jpg" style="width: 200px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20158iF4F645ECFB7E79AC/image-size/small?v=v2&amp;amp;px=200" role="button" title="splunk_search.jpg" alt="splunk_search.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2022 06:00:20 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2022-06-18T06:00:20Z</dc:date>
    <item>
      <title>How to Merge two query resultsets?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602283#M209639</link>
      <description>&lt;P&gt;I have two Searches and following are its result individually -&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index="myindex" &amp;lt;my search 1&amp;gt; | table App Size Count&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;App&amp;nbsp; Size&amp;nbsp; Count&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App1 5GB&amp;nbsp; &amp;nbsp;100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App2 100GB 10000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index=myindex" &amp;lt;my search 2&amp;gt; | table App Size Count&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;App&amp;nbsp; Size Count&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App3 15GB 1500&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now I want to run a report that shows result of all Apps (1 to 3) together. So, I used append.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index="myindex" &amp;lt;my search 1&amp;gt; | table App Size Count&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| append&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[search index=myindex" &amp;lt;my search 2&amp;gt; | table App Size Count]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| addcoltotals&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;But when I used it, I didn't get the complete result. "Size" column is showing different value. Something like this -&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;App&amp;nbsp; Size&amp;nbsp; Count&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App1 5GB&amp;nbsp; &amp;nbsp;100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App2 100GB 10000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;App3 7GB&amp;nbsp; &amp;nbsp;720&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;What should be used to get the complete resultset as we got for each search. Best way to merge two query resultsets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 15:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602283#M209639</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2022-06-21T15:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two query resultsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602299#M209641</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/138387"&gt;@runiyal&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried to put all the conditions in the main search?&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (&amp;lt;my search 1&amp;gt; OR &amp;lt;my search 2&amp;gt;)
| table App Size Count
| addcoltotals&lt;/LI-CODE&gt;&lt;P&gt;Splunk isn't a DB!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2022 05:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602299#M209641</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-06-18T05:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two query resultsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602303#M209644</link>
      <description>&lt;P&gt;You may try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (search1 terms OR search2 terms) |table App,Size,Count|addcoltotals&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_search.jpg" style="width: 200px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20158iF4F645ECFB7E79AC/image-size/small?v=v2&amp;amp;px=200" role="button" title="splunk_search.jpg" alt="splunk_search.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2022 06:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602303#M209644</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2022-06-18T06:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two query resultsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602343#M209654</link>
      <description>&lt;P&gt;Here is the updated Query which actual use of REX/EVAL/CASE/STATS in it:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;(index="myindex" "*upload succeeded" OR "*streaming succeeded" NOT "source"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex ".*SIZE=(?&amp;lt;sizeKB&amp;gt;\d+\.\d+)" | stats sum(eval(sizeKB/1024/1024)) AS Size count | eval App="Upload-Manual")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(index="myindex" "*upload succeeded" OR "*streaming succeeded"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "source=(?&amp;lt;App&amp;gt;[^,]+)." &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "system=(?&amp;lt;App&amp;gt;[^,]+)." | eval App = case(App="FB","App1",App="TWTR","App2",App="Salesforce","App3",App="SAP","App3",App="Oracle","App3")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex ".*SIZE=(?&amp;lt;sizeKB&amp;gt;\d+\.\d+)" | stats sum(eval(sizeKB/1024/1024)) AS Size Count by App)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| table App Size Count&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| addcoltotals&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting following error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error in 'search' command: Unable to parse the search: unbalanced parentheses.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 15:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602343#M209654</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2022-06-19T15:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two query resultsets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602344#M209655</link>
      <description>&lt;P&gt;must be missing our something in the syntax but if I just use the OR between two searches like below I am getting&amp;nbsp;&lt;STRONG&gt;Error in 'search' command: Unable to parse the search: unbalanced parentheses.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;(&amp;lt;my search 1&amp;gt; OR &amp;lt;my search 2&amp;gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have provided the complete search command above in reply to Renjith.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 15:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Merge-two-query-resultsets/m-p/602344#M209655</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2022-06-19T15:44:55Z</dc:date>
    </item>
  </channel>
</rss>

