<?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: combine 2 queried and combine results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384964#M172146</link>
    <description>&lt;P&gt;The searches share all the same fields, just different values. The 1st search returns events for inbound call records while the 2nd search returns outbound calls records. Trying to take those 2 values by client_name and total them up to get a total duration.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2019 18:01:43 GMT</pubDate>
    <dc:creator>fmatera</dc:creator>
    <dc:date>2019-03-29T18:01:43Z</dc:date>
    <item>
      <title>combine 2 queried and combine results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384962#M172144</link>
      <description>&lt;P&gt;I have 2 good searches. One outputs:&lt;BR /&gt;
Date    Agent   Answered Calls  Average Talk Time   Longest Talk Time   Total Talk Time&lt;BR /&gt;
By agent/client_name&lt;BR /&gt;
The second has outbound minutes (OBMINS1) by client name.&lt;/P&gt;

&lt;P&gt;What I would like to do is add a column OBMINS1 to the 1st table and add this result to Total Talk Time. &lt;/P&gt;

&lt;P&gt;I tried using appendcols but can't seem the values to line up by client_name.&lt;/P&gt;

&lt;P&gt;Here are the 2 queries that work:&lt;/P&gt;

&lt;P&gt;base search&lt;BR /&gt;
| addinfo | convert timeformat="%A, %m/%d/%Y" ctime(_time) AS Date&lt;BR /&gt;
| dedup callid sortby disposion&lt;BR /&gt;
| stats  count(_raw) as Total, count(eval(disposion="ANSWERED")) as Answered, count(eval(disposion="NO ANSWER" OR disposion="BUSY" OR disposion="FAILED" OR disposion="NOT ALLOWED")) as "Abandoned Calls", count(eval(application="Voicemail")) as "Voicemail Calls" sum(Dur) AS Seconds, max(Dur) as Longest by Date, client_name&lt;BR /&gt;
| eval ASR=round(Answered/Total*100,2)."%"&lt;BR /&gt;
| eval Minutes=round(Seconds/60,0)&lt;BR /&gt;
| eval OBMINS=round(OBSeconds/60,0)&lt;BR /&gt;
| eval ALOC=round(Minutes/Answered,2)&lt;BR /&gt;
| eval TotDur=tostring(Seconds, "duration")&lt;BR /&gt;
| eval "Longest Talk Time"=tostring(Longest, "duration")&lt;BR /&gt;
| rename client_name as Agent, TotDur as "Total Talk Time", ALOC as "Average Talk Time", Total as "Total Calls", Answered as "Answered Calls"&lt;BR /&gt;
| table  Date, Agent, "Answered Calls", "Average Talk Time", "Longest Talk Time", "Total Talk Time"&lt;BR /&gt;
| addcoltotals "Answered Calls", labelfield=Date label=Totals&lt;/P&gt;

&lt;P&gt;2nd search&lt;BR /&gt;
base search&lt;BR /&gt;
| stats count(_raw) as TotalOB, count(eval(disposion="ANSWERED")) as OBAnswered, count(eval(disposion="NO ANSWER" OR disposion="BUSY" OR disposion="FAILED" OR disposion="NOT ALLOWED")) as "OBAbandoned Calls", sum(Dur) AS OBSeconds by client_name | eval OBMINS1=tostring(OBSeconds, "duration")&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:54:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384962#M172144</guid>
      <dc:creator>fmatera</dc:creator>
      <dc:date>2020-09-29T23:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: combine 2 queried and combine results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384963#M172145</link>
      <description>&lt;P&gt;are the two queries using the same data in the base searches? same index? sourcetype? anything similar? Could be that we could avoid joins all together and do something with stats/eventstats type work. would help to know the base search.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 17:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384963#M172145</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2019-03-29T17:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: combine 2 queried and combine results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384964#M172146</link>
      <description>&lt;P&gt;The searches share all the same fields, just different values. The 1st search returns events for inbound call records while the 2nd search returns outbound calls records. Trying to take those 2 values by client_name and total them up to get a total duration.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 18:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384964#M172146</guid>
      <dc:creator>fmatera</dc:creator>
      <dc:date>2019-03-29T18:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: combine 2 queried and combine results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384965#M172147</link>
      <description>&lt;P&gt;1st search &lt;/P&gt;

&lt;P&gt;index=cdr flow=in client_client_id=1110  partyid=111000200  calltype=local OR calltype=out&lt;/P&gt;

&lt;P&gt;2nd search&lt;/P&gt;

&lt;P&gt;index=cdr  client_client_id=1110   flow=out calltype=out&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/combine-2-queried-and-combine-results/m-p/384965#M172147</guid>
      <dc:creator>fmatera</dc:creator>
      <dc:date>2020-09-29T23:50:29Z</dc:date>
    </item>
  </channel>
</rss>

