<?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 merge multiple searches and combine the result in a tabular format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314944#M94281</link>
    <description>&lt;P&gt;I tried that as well. IN both cases events are being captured for ErrorResponse but the eval is not working as expected. Can we use search with eval or something like that to get the actual count of events having ErrorResponse?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 21:30:00 GMT</pubDate>
    <dc:creator>kdulhan</dc:creator>
    <dc:date>2017-08-31T21:30:00Z</dc:date>
    <item>
      <title>How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314929#M94266</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have the below independent search queries giving the count.&lt;/P&gt;

&lt;P&gt;ns=app1 Service='trigger1' id=100 | Search Response | stats counts as "Success Count"&lt;BR /&gt;
ns=app1 Service='trigger2' id=100 OR 110 | Search Response | stats counts as "Success Count1"&lt;/P&gt;

&lt;P&gt;I want to put a table with two columns as:&lt;BR /&gt;
Success Count  Success Count1&lt;BR /&gt;
XXXXXX               YYYYYY&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:25:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314929#M94266</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T15:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314930#M94267</link>
      <description>&lt;P&gt;Is "Search Response" the same in both queries?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314930#M94267</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-31T15:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314931#M94268</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 (Service='trigger1' id=100) OR (Service='trigger2' id=100 OR id=110)
| chart count over ns by Service
| table trigger1 trigger2 | rename trigger1 as "Success Count" trigger2 as "Success Count1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated per last comment&lt;/STRONG&gt;&lt;BR /&gt;
If your field values for Service and ActNo doesn't contains single quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 Service='trigger1' id=100 ActNo=* Response
| eval count1=if(AccNo="101",1,0)
| eval count2=if(count1=1,0,1)
| stats sum(count1) as "Success Count" sum(count2) as "Success Count1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If they do contain single quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 Service='trigger1' id=100 ActNo=* Response
| eval count1=if(AccNo="'101'",1,0)
| eval count2=if(count1=1,0,1)
| stats sum(count1) as "Success Count" sum(count2) as "Success Count1"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314931#M94268</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T15:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314932#M94269</link>
      <description>&lt;P&gt;Thanks for the response.&lt;/P&gt;

&lt;P&gt;There is a slight change in the above input data as it was missed from my side.&lt;/P&gt;

&lt;P&gt;ns=app1 Service='trigger1' id=100 ActNo='101' | Search Response | stats counts as "Success Count"&lt;BR /&gt;
ns=app1 Service='trigger1' id=100 OR 110  ActNo!='100' | Search Response | stats counts as "Success Count1"&lt;/P&gt;

&lt;P&gt;I want to put a table with two columns as:&lt;BR /&gt;
Success Count Success Count1&lt;BR /&gt;
XXXXXX              YYYYYY&lt;/P&gt;

&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314932#M94269</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314933#M94270</link>
      <description>&lt;P&gt;In 2nd search, is it &lt;CODE&gt;id=100 OR 110&lt;/CODE&gt; OR &lt;CODE&gt;id=100 OR id=110&lt;/CODE&gt;? Both are different as in first one it searches for field id=100 and 110 number in raw data.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314933#M94270</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T16:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314934#M94271</link>
      <description>&lt;P&gt;also in the second search, is it &lt;CODE&gt;Service='trigger2'&lt;/CODE&gt;, as you had mentioned in the original post?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 17:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314934#M94271</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-08-31T17:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314935#M94272</link>
      <description>&lt;P&gt;Data is as below:&lt;/P&gt;

&lt;P&gt;ns=app1 Service='trigger1' id=100 ActNo='101' | Search Response | stats counts as "Success Count"&lt;BR /&gt;
ns=app1 Service='trigger1' id=100 ActNo!='100' | Search Response | stats counts as "Success Count1"&lt;/P&gt;

&lt;P&gt;I want to put a table with two columns as:&lt;BR /&gt;
Success Count Success Count1&lt;BR /&gt;
XXXXXX              YYYYYY&lt;/P&gt;

&lt;P&gt;Service='trigger1' only. ActNo can have range of values in second case.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 19:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314935#M94272</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T19:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314936#M94273</link>
      <description>&lt;P&gt;ns=app1 Service='trigger1' id=100 ActNo='101' | Search Response | stats counts as "Success Count"&lt;BR /&gt;
Returns the count of events with ActNo='101' only and Response indicate and a success response.&lt;/P&gt;

&lt;P&gt;ns=app1 Service='trigger1' id=100 OR 110 ActNo!='100' | Search Response | stats counts as "Success Count1"&lt;BR /&gt;
Returns the count of events with ActNo!='100' which means it can be many and Response indicate and a success response.&lt;/P&gt;

&lt;P&gt;I want to put a table with two columns as:&lt;BR /&gt;
Success Count Success Count1&lt;BR /&gt;
XXXXXX YYYYYY&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 19:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314936#M94273</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T19:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314937#M94274</link>
      <description>&lt;P&gt;Try update answer.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 19:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314937#M94274</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314938#M94275</link>
      <description>&lt;P&gt;Thanks, it worked.&lt;/P&gt;

&lt;P&gt;Now I have a failed response which has event like&lt;/P&gt;

&lt;P&gt;ns=app1 [ErrorResponse] Service='trigger1' id=100.&lt;/P&gt;

&lt;P&gt;How can I add it to the above Search in order to get Failed Counts.&lt;/P&gt;

&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 20:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314938#M94275</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T20:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314939#M94276</link>
      <description>&lt;P&gt;Does the failed response have ActNo field?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 20:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314939#M94276</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T20:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314940#M94277</link>
      <description>&lt;P&gt;No, it is just an [ErrorResponse] that gets logged in logs.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 20:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314940#M94277</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T20:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314941#M94278</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 Service='trigger1' id=100 (ActNo=* Response) OR ([ErrorResponse])
| eval count1=if(searchmatch("[ErrorResponse]"),1,0)
 | eval count2=if(count1=0 AND AccNo="101",1,0)
 | eval count3=if(count1=0 AND count2=0,1,0)
 | stats sum(count1) as "Failed Count" sum(count2) as "Success Count" sum(count3) as "Success Count1"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 20:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314941#M94278</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314942#M94279</link>
      <description>&lt;P&gt;The events are being captured for ErrorResponse but the count3 is not being calculated.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314942#M94279</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T21:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314943#M94280</link>
      <description>&lt;P&gt;May be try by getting rid of square bracket around the ErrorResponse (update both base search and eval for count1.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314943#M94280</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T21:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314944#M94281</link>
      <description>&lt;P&gt;I tried that as well. IN both cases events are being captured for ErrorResponse but the eval is not working as expected. Can we use search with eval or something like that to get the actual count of events having ErrorResponse?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314944#M94281</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T21:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314945#M94282</link>
      <description>&lt;P&gt;Is there any way where we can search ErrorResponse independently and club the count with count1 and count2 in a tabular format?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314945#M94282</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T21:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314946#M94283</link>
      <description>&lt;P&gt;You can but it won't be most efficient solution (two searches running)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 Service='trigger1' id=100 ActNo=* Response
 | eval count1=if(AccNo="101",1,0)
 | eval count2=if(count1=1,0,1)
 | stats sum(count1) as "Success Count" sum(count2) as "Success Count1"
| appendcols  [search ns=app1 [ErrorResponse] Service='trigger1' id=100 | stats count as "Failed Count" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314946#M94283</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-31T21:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314947#M94284</link>
      <description>&lt;P&gt;Yes it worked, thanks a ton.&lt;/P&gt;

&lt;P&gt;I have another query posed on the same line with subject 'Searching a particular field and performing actions based on its presence and value'. I think you might be able to help me quickly in that.&lt;/P&gt;

&lt;P&gt;Thank You!.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 22:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314947#M94284</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T22:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge multiple searches and combine the result in a tabular format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314948#M94285</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In order to search for the error records, I use :&lt;BR /&gt;
ns=app1 Service='trigger1' Id!='temp-100' | Search ErrorResponse&lt;/P&gt;

&lt;P&gt;Here I get an event like:&lt;BR /&gt;
timestamp ns=app1 [ErrorResponse] Service='trigger1' id=105 ActNo=1234&lt;/P&gt;

&lt;P&gt;Now I have to fetch this ActNo field and search with only ActNo=1234. It will list many events and in those I have to look for a field appId = 'New1'. If New1, I have to add it to a counter1 else counter2. &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 09:21:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-multiple-searches-and-combine-the-result-in-a/m-p/314948#M94285</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-09-01T09:21:55Z</dc:date>
    </item>
  </channel>
</rss>

