<?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 appendcols - How can I match the same row in a query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446242#M126604</link>
    <description>&lt;P&gt;Hi All&lt;BR /&gt;
I have a query that join two searches &lt;BR /&gt;
I need to complete the information from the second query in the same row that the first&lt;BR /&gt;
 &lt;IMG src="https://community.splunk.com/storage/temp/273597-splunk.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;How can I do?&lt;/P&gt;

&lt;P&gt;This is the query&lt;/P&gt;

&lt;P&gt;index=aa source=aa_bb sourcetype=test C&lt;BR /&gt;
                 | dedup QUEUE_CITY QUEUE_NUMBER&lt;BR /&gt;
                 |stats sum(PNR_COUNT) as "Total of PNRs on Desk" sum(AGENT_COUNT) as "Total of Agents on Desk"  by DESK &lt;BR /&gt;
                 | replace "0" WITH " " IN "Total of PNRs on Desk" "Total of Agents on Desk" &lt;BR /&gt;
                 | rename DESK as Desk&lt;BR /&gt;
                 | appendcols  [search sourcetype=pnr_by_queue | dedup QUEUE_CITY QUEUE_NUMBER|stats sum(PNRS3DAY) sum(PNRS4TO6DAYS) sum(PNRS7TO10DAYS) sum(PNRS11DAYS)  by DESK | rename sum(PNRS3DAY) as "PNRs Departing in 3 Days", sum(PNRS4TO6DAYS) as "PNRs Departing between 4 to 6 Days" sum(PNRS7TO10DAYS) as "PNRs Departing between 7 to 10 days"  sum(PNRS11DAYS) as "PNRs Departing in 11 Days or more" | table  DESK  "PNRs Departing in 3 Days" "PNRs Departing between 4 to 6 Days" "PNRs Departing between 7 to 10 days" "PNRs Departing in 11 Days or more" ] &lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:24:59 GMT</pubDate>
    <dc:creator>maridelfi</dc:creator>
    <dc:date>2020-09-30T00:24:59Z</dc:date>
    <item>
      <title>appendcols - How can I match the same row in a query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446242#M126604</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;
I have a query that join two searches &lt;BR /&gt;
I need to complete the information from the second query in the same row that the first&lt;BR /&gt;
 &lt;IMG src="https://community.splunk.com/storage/temp/273597-splunk.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;How can I do?&lt;/P&gt;

&lt;P&gt;This is the query&lt;/P&gt;

&lt;P&gt;index=aa source=aa_bb sourcetype=test C&lt;BR /&gt;
                 | dedup QUEUE_CITY QUEUE_NUMBER&lt;BR /&gt;
                 |stats sum(PNR_COUNT) as "Total of PNRs on Desk" sum(AGENT_COUNT) as "Total of Agents on Desk"  by DESK &lt;BR /&gt;
                 | replace "0" WITH " " IN "Total of PNRs on Desk" "Total of Agents on Desk" &lt;BR /&gt;
                 | rename DESK as Desk&lt;BR /&gt;
                 | appendcols  [search sourcetype=pnr_by_queue | dedup QUEUE_CITY QUEUE_NUMBER|stats sum(PNRS3DAY) sum(PNRS4TO6DAYS) sum(PNRS7TO10DAYS) sum(PNRS11DAYS)  by DESK | rename sum(PNRS3DAY) as "PNRs Departing in 3 Days", sum(PNRS4TO6DAYS) as "PNRs Departing between 4 to 6 Days" sum(PNRS7TO10DAYS) as "PNRs Departing between 7 to 10 days"  sum(PNRS11DAYS) as "PNRs Departing in 11 Days or more" | table  DESK  "PNRs Departing in 3 Days" "PNRs Departing between 4 to 6 Days" "PNRs Departing between 7 to 10 days" "PNRs Departing in 11 Days or more" ] &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446242#M126604</guid>
      <dc:creator>maridelfi</dc:creator>
      <dc:date>2020-09-30T00:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols - How can I match the same row in a query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446243#M126605</link>
      <description>&lt;P&gt;Try like this (appendcols just joins two result set side by side, it doesn't do any match. Join command does that but it's resource intensive, so try this join alternative command)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=aa source=aa_bb sourcetype=test C
| dedup QUEUE_CITY QUEUE_NUMBER
|stats sum(PNR_COUNT) as "Total of PNRs on Desk" sum(AGENT_COUNT) as "Total of Agents on Desk" by DESK 
| replace "0" WITH " " IN "Total of PNRs on Desk" "Total of Agents on Desk" 

| append [search sourcetype=pnr_by_queue | dedup QUEUE_CITY QUEUE_NUMBER|stats sum(PNRS3DAY) sum(PNRS4TO6DAYS) sum(PNRS7TO10DAYS) sum(PNRS11DAYS) by DESK | rename sum(PNRS3DAY) as "PNRs Departing in 3 Days", sum(PNRS4TO6DAYS) as "PNRs Departing between 4 to 6 Days" sum(PNRS7TO10DAYS) as "PNRs Departing between 7 to 10 days" sum(PNRS11DAYS) as "PNRs Departing in 11 Days or more" | table DESK "PNRs Departing in 3 Days" "PNRs Departing between 4 to 6 Days" "PNRs Departing between 7 to 10 days" "PNRs Departing in 11 Days or more"   ] 
| stats values(*) as * by DESK
| rename DESK as Desk
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 21:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446243#M126605</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-05-02T21:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols - How can I match the same row in a query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446244#M126606</link>
      <description>&lt;P&gt;Perfect!, This works as I wanted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for your time&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 14:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-How-can-I-match-the-same-row-in-a-query/m-p/446244#M126606</guid>
      <dc:creator>maridelfi</dc:creator>
      <dc:date>2019-05-03T14:05:44Z</dc:date>
    </item>
  </channel>
</rss>

