<?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 duplicate values from two search results in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119099#M24744</link>
    <description>&lt;P&gt;Thanks Martin &amp;amp; Somesoni for your help. Its working as our expectation. I really need to explore lot of stuffs in SPL&lt;/P&gt;

&lt;P&gt;Thanks for your guidance .&lt;/P&gt;

&lt;P&gt;The final results,&lt;/P&gt;

&lt;H2&gt;ExceptionList               Last5Mins   count   IsNew&lt;/H2&gt;

&lt;P&gt;com.ibm.db2.jcc.am.SqlException         0   1   YES&lt;BR /&gt;
java.lang.IllegalArgumentException      0   2   YES&lt;BR /&gt;
java.lang.IllegalStateException         1   3   NO&lt;BR /&gt;
java.lang.RuntimeException          0   7   NO&lt;BR /&gt;
java.nio.file.FileSystemNotFoundException   0   5   NO&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jun 2014 06:21:53 GMT</pubDate>
    <dc:creator>Smith_Splunk</dc:creator>
    <dc:date>2014-06-30T06:21:53Z</dc:date>
    <item>
      <title>Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119087#M24732</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This question is slightly different from other related question. I have searched all the Splunk answers and couldn’t able to locate properly&lt;/P&gt;

&lt;P&gt;I have a requirement to display all the exceptions along with last 5 mins and total count and also highlight the exceptions from the new release version in a table format.&lt;/P&gt;

&lt;P&gt;I have formulated the two search queries based on the two different timestamp. The first is query is to run for the previous build versions timestamp and second query is to run for current build timestamp&lt;/P&gt;

&lt;P&gt;The query is below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc earliest=1394424000 latest=1394510400| chart count by ExceptionList | append[search index=abc earliest=1394510400 latest=1394596800 | chart count  by ExceptionList|] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results are, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**Results from query 1**
**ExceptionList                     count**
java.lang.IllegalArgumentException              1
java.nio.file.FileSystemNotFoundException           24
java.lang.IllegalStateException             15
java.lang.NullPointerException              15
com.ibm.db2.jcc.am.SqlException             1
**Results from query 2**
java.nio.file.FileSystemNotFoundException           20
java.lang.IllegalStateException             8
java.lang.FileNotFoundException             17
java.lang.StringIndexOutOfBoundsException           1
javax.xml.bind.MarshalException             2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From the above results “java.lang.IllegalStateException” &amp;amp; “java.nio.file.FileSystemNotFoundException” is repeated twice. I need to combine similar exception from two search results and display the total count.&lt;/P&gt;

&lt;P&gt;The results should like,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**ExceptionList                     count**
java.lang.IllegalArgumentException              1
java.nio.file.FileSystemNotFoundException           44
java.lang.IllegalStateException             23
java.lang.NullPointerException              15
com.ibm.db2.jcc.am.SqlException             1
java.lang.NullPointerException              17
java.lang.StringIndexOutOfBoundsException           1
javax.xml.bind.MarshalException             2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone please suggest the approach to get above results. &lt;/P&gt;

&lt;P&gt;To display Last5hrs and totalCount I have used below query. But while displaying the Exception count it’s not proper.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval label = if(now() - _time &amp;lt;= 5*3600, "last5hrs;totalCount", "totalCount")) | makemv label delim=";" | chart count by ExceptionList label
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please suggest better approach or solutions for this use case.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Smith&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 05:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119087#M24732</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-25T05:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119088#M24733</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;You can get this by using the "cluster" command, that groups similar events into clusters.&lt;/P&gt;

&lt;P&gt;Doc reference:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/Cluster"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/Cluster&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 07:26:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119088#M24733</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2014-06-25T07:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119089#M24734</link>
      <description>&lt;P&gt;Are you possibly looking for this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc earliest=1394424000 latest=1394596800 | chart count  by ExceptionList
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will automatically sum up exceptions occurring in both time ranges.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 07:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119089#M24734</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-25T07:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119090#M24735</link>
      <description>&lt;P&gt;Also, your query at the bottom calculates five hours but uses five minutes as a label - that's probably unintended. Take a look at &lt;CODE&gt;eval&lt;/CODE&gt;'s &lt;CODE&gt;relative_time()&lt;/CODE&gt; function for doing time-based calculations.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 07:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119090#M24735</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-25T07:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119091#M24736</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks for quick response.&lt;/P&gt;

&lt;P&gt;"Cluster" command is used to group similar events irrespective of timestamp. But in our case we need to get the different exceptions based on the two different timestamp.&lt;/P&gt;

&lt;P&gt;Eg: &lt;BR /&gt;
Release 1.0 - earliest=1394424000 latest=1394510400&lt;BR /&gt;
Release 1.2 - earliest=1394510400 latest=now()&lt;/P&gt;

&lt;P&gt;earliest is the time at which particular release is deployed&lt;/P&gt;

&lt;P&gt;ExceptionList - We have extracted using regex from the log&lt;/P&gt;

&lt;P&gt;Combine these 2 results and highlight newly added ExceptionList produced by Release 1.2&lt;/P&gt;

&lt;P&gt;could you please provide the approach to achieve the same.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Smith&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 13:46:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119091#M24736</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-26T13:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119092#M24737</link>
      <description>&lt;P&gt;Hi Mueller,&lt;/P&gt;

&lt;P&gt;My requirement in a nutshell - "Identify &amp;amp; Highlight the Exceptions newly introduced by the latest release deployment ".&lt;/P&gt;

&lt;P&gt;We need to compare the list of exceptions generated in previous Release-say Rel_1.0, with the latest release Rel_1.1.&lt;/P&gt;

&lt;P&gt;Hence we have two time ranges corresponding to the deployment time.&lt;/P&gt;

&lt;P&gt;For Eg: Rel_1.0 deployed on 01-Jun-2014 and Rel_1.1 on 25-Jun-2014 (11 AM)&lt;/P&gt;

&lt;P&gt;In this case i will get the exception list (extracted from the logs) from time range 01-June till 25-June(11 AM) for Rel_1.0 and 25-June(11 AM) till now for Rel_1.1 &lt;BR /&gt;
                     .....continue&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119092#M24737</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2020-09-28T16:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119093#M24738</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;Rel_1.0&lt;BR /&gt;
Exception                           Count&lt;BR /&gt;
java.lang.NullPointerException       5&lt;BR /&gt;
java.lang.illegalArgumentException   3&lt;/P&gt;

&lt;P&gt;Rel_1.1&lt;BR /&gt;
Exception                           Count&lt;BR /&gt;
java.lang.NullPointerException       2&lt;BR /&gt;
java.lang.FileNotFoundException      1&lt;/P&gt;

&lt;P&gt;Our End Result should be&lt;/P&gt;

&lt;P&gt;Exception                           Count&lt;BR /&gt;
java.lang.NullPointerException       2&lt;BR /&gt;
*&lt;EM&gt;java.lang.FileNotFoundException    1 *&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;** - Highlight Newly introduced exception&lt;/P&gt;

&lt;P&gt;Kindly provide your valuable suggestions.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Smith&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119093#M24738</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-26T14:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119094#M24739</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|multisearch [search index=abc earliest=1394424000 latest=1394510400 | eval label="Release 1.0"][ search index=abc earliest=1394510400 latest=now| eval label="Release 1.2"] | stats count, values(label) as label by ExceptionList | eval IsNew=if(mvcount(label)=1 AND mvindex(label,0)="Release 1.2","YES","NO") | table ExceptionList , count ,IsNew
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119094#M24739</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-26T14:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119095#M24740</link>
      <description>&lt;P&gt;I see. Do test @somesoni2's suggestion, it might do what you need.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 15:50:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119095#M24740</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-26T15:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119096#M24741</link>
      <description>&lt;P&gt;Thanks Somesoni. It works as expected.&lt;/P&gt;

&lt;P&gt;We have one more addition to the above requirement :&lt;/P&gt;

&lt;P&gt;Need to display Last 5 Minutes along with TotalCount in same table&lt;/P&gt;

&lt;P&gt;We tried below query and the results are not proper.&lt;BR /&gt;
&lt;THE above="" query=""&gt;|eval range=if(now - _time &amp;lt;= 5*60, "last5Mins;TotalCount", "TotalCount") | makemv range delim=";"&lt;/THE&gt;&lt;/P&gt;

&lt;P&gt;could you please provide the approach to display Last5Mins count as well.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Smith&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2014 13:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119096#M24741</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-27T13:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119097#M24742</link>
      <description>&lt;P&gt;can you provide the expected table with Last5mins count? This last 5min count would be just for latest release?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2014 13:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119097#M24742</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-27T13:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119098#M24743</link>
      <description>&lt;P&gt;Based on the above search I'd suggest this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch
  [search index=abc earliest=1394424000 latest=1394510400 | eval label="Release 1.0"]
  [search index=abc earliest=1394510400 latest=now | eval label="Release 1.2"]
| eval Last5Mins = if(_time &amp;gt;= relative_time(now(), "-5m"), 1, 0)
| stats count, sum(Last5Mins) as Last5Mins values(label) as label by ExceptionList 
| eval IsNew=if(mvcount(label)=1 AND mvindex(label,0)="Release 1.2","YES","NO")
| table ExceptionList, count, IsNew
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For each Exception type you'd get a field with its count in the last 5 minutes.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119098#M24743</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-27T14:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119099#M24744</link>
      <description>&lt;P&gt;Thanks Martin &amp;amp; Somesoni for your help. Its working as our expectation. I really need to explore lot of stuffs in SPL&lt;/P&gt;

&lt;P&gt;Thanks for your guidance .&lt;/P&gt;

&lt;P&gt;The final results,&lt;/P&gt;

&lt;H2&gt;ExceptionList               Last5Mins   count   IsNew&lt;/H2&gt;

&lt;P&gt;com.ibm.db2.jcc.am.SqlException         0   1   YES&lt;BR /&gt;
java.lang.IllegalArgumentException      0   2   YES&lt;BR /&gt;
java.lang.IllegalStateException         1   3   NO&lt;BR /&gt;
java.lang.RuntimeException          0   7   NO&lt;BR /&gt;
java.nio.file.FileSystemNotFoundException   0   5   NO&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 06:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119099#M24744</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-30T06:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Combine duplicate values from two search results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119100#M24745</link>
      <description>&lt;P&gt;Both above query and below one are working fine&lt;/P&gt;

&lt;P&gt;|multisearch [search index=abc earliest=1403508847 latest=1403688907| eval label="Release 1.0"][ search &lt;BR /&gt;
index=abc earliest=1403688907 latest=now| eval label="Release 1.2"] | eval timeRange = if(1403697000 - _time &amp;lt;= 5*60, &lt;BR /&gt;
1, 0)|stats count, sum(timeRange) as Last5Min, values(label) as label by ExceptionList | eval IsNew=if&lt;BR /&gt;
(mvcount(label)=1 AND mvindex(label,0)="Release 1.2","YES","NO") | table ExceptionList , Last5Min, count ,IsNew&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 06:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-duplicate-values-from-two-search-results/m-p/119100#M24745</guid>
      <dc:creator>Smith_Splunk</dc:creator>
      <dc:date>2014-06-30T06:27:48Z</dc:date>
    </item>
  </channel>
</rss>

