<?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 two searches for stats command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256674#M76861</link>
    <description>&lt;P&gt;I was trying Joining the 2 searches but "appendcols" worked like a charm...thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2016 12:03:23 GMT</pubDate>
    <dc:creator>prakashbhanu407</dc:creator>
    <dc:date>2016-03-22T12:03:23Z</dc:date>
    <item>
      <title>How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256670#M76857</link>
      <description>&lt;P&gt;I have 2 queries and need to show the result of both in one table&lt;/P&gt;

&lt;P&gt;index=someindex queryType="ts" filename=&lt;EM&gt;PNASC.HRBDT&lt;/EM&gt; status=1 | dedup filename |rename filename as Daily|  stats count(Daily)&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="Daily Query Output"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1162i691BEB4F5340E762/image-size/large?v=v2&amp;amp;px=999" role="button" title="Daily Query Output" alt="Daily Query Output" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=someindex queryType="ts" filename=&lt;EM&gt;RECON&lt;/EM&gt; status=1 | dedup filename |rename filename as Weekly  |  stats count(Weekly)&lt;/P&gt;

&lt;P&gt;both the above queries work individually but when joined as below &lt;/P&gt;

&lt;P&gt;index=someindex queryType="ts" filename=&lt;EM&gt;RECON&lt;/EM&gt; status=1| dedup filename |rename filename as Weekly| join queryType [search index=someindex queryType="ts" filename=&lt;EM&gt;PNASC.HRBDT&lt;/EM&gt; status=1 | dedup filename |rename filename as Daily ]|  stats count(Daily),count(Weekly)&lt;/P&gt;

&lt;P&gt;gives incorrect output&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Joined query output"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1163i76022E856E043A81/image-size/large?v=v2&amp;amp;px=999" role="button" title="Joined query output" alt="Joined query output" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 03:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256670#M76857</guid>
      <dc:creator>prakashbhanu407</dc:creator>
      <dc:date>2016-03-22T03:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256671#M76858</link>
      <description>&lt;P&gt;I am not sure why you are deduping. Assuming that's what you want...try  this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someindex queryType="ts" filename=RECON OR filename=PNASC.HRBDT status=1| dedup filename | stats count by  filename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Mar 2016 04:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256671#M76858</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2016-03-22T04:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256672#M76859</link>
      <description>&lt;P&gt;try like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someindex queryType="ts" filename=PNASC.HRBDT status=1 | dedup filename |rename filename as Daily| stats count(Daily)|appendcols  [search index=someindex queryType="ts" filename=RECON status=1 | dedup filename |rename filename as Weekly | stats count(Weekly)]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Mar 2016 09:21:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256672#M76859</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-03-22T09:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256673#M76860</link>
      <description>&lt;P&gt;The files have date timestamp extension and I need to show them bundled by the types...hence this will not work.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 12:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256673#M76860</guid>
      <dc:creator>prakashbhanu407</dc:creator>
      <dc:date>2016-03-22T12:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256674#M76861</link>
      <description>&lt;P&gt;I was trying Joining the 2 searches but "appendcols" worked like a charm...thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 12:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/256674#M76861</guid>
      <dc:creator>prakashbhanu407</dc:creator>
      <dc:date>2016-03-22T12:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches for stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/512270#M143667</link>
      <description>&lt;P&gt;Perfect!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 06:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches-for-stats-command/m-p/512270#M143667</guid>
      <dc:creator>seeyonraj</dc:creator>
      <dc:date>2020-08-04T06:11:57Z</dc:date>
    </item>
  </channel>
</rss>

