<?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 How do you do a multisearch query with the dedup command in a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442644#M125638</link>
    <description>&lt;P&gt;I need to search on multiple indexes with the need of the dedup command on one of the searches, for which I only need to pull unique events based on one of the fields. I can get the expected results with the below query, but it's really slow (if the search is run for 24 hrs). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=x  “32432” “client” | append [search index=y “23232” “client” ] | append [search index=z “2323” “client” | spath "EventStreamData.args.id” | rename"EventStreamData.args.id” as ID | dedup ID ] | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" 
| timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count count(eval(Event_Name==“2323” )) as z_count
| table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I have the below query which performs way better, but I am not able to use dedup in this for the subsearch.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=x “32432”) OR (index=y “23232”) OR (index=z “2323”) “client” | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" 
| timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count count(eval(Event_Name==“2323” )) as z_count
| table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is, how can I improve the performance of the first query or add dedup for index "z" to the second query to filter it only for unique queries? &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 15:19:39 GMT</pubDate>
    <dc:creator>amdhindsa</dc:creator>
    <dc:date>2019-02-01T15:19:39Z</dc:date>
    <item>
      <title>How do you do a multisearch query with the dedup command in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442644#M125638</link>
      <description>&lt;P&gt;I need to search on multiple indexes with the need of the dedup command on one of the searches, for which I only need to pull unique events based on one of the fields. I can get the expected results with the below query, but it's really slow (if the search is run for 24 hrs). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=x  “32432” “client” | append [search index=y “23232” “client” ] | append [search index=z “2323” “client” | spath "EventStreamData.args.id” | rename"EventStreamData.args.id” as ID | dedup ID ] | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" 
| timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count count(eval(Event_Name==“2323” )) as z_count
| table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I have the below query which performs way better, but I am not able to use dedup in this for the subsearch.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=x “32432”) OR (index=y “23232”) OR (index=z “2323”) “client” | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" 
| timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count count(eval(Event_Name==“2323” )) as z_count
| table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is, how can I improve the performance of the first query or add dedup for index "z" to the second query to filter it only for unique queries? &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 15:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442644#M125638</guid>
      <dc:creator>amdhindsa</dc:creator>
      <dc:date>2019-02-01T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a multisearch query with the dedup command in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442645#M125639</link>
      <description>&lt;P&gt;Try below search, it should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=x “32432”) OR (index=y “23232”) OR (index=z “2323”) “client” | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" |spath "EventStreamData.args.id" as "Id"| eval new_id= if(Event_Name==“2323”,Id,NULL)
 | timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count dc(eval(ISNOTNULL(new_Id )) as z_count
 | table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442645#M125639</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-02-01T19:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a multisearch query with the dedup command in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442646#M125640</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=x  AND "32432" AND "client") OR (index=y AND "23232" AND "client") OR (index=z AND "2323" AND client")
| spath "EventStreamData.args.id"
| rename"EventStreamData.args.id" AS ID
| dedup ID
| spath "EventStreamData.eventName"
| rename "EventStreamData.eventName" AS "Event_Name" 
| timechart span=1h count(eval(Event_Name=="32432")) As x_count count(eval(Event_Name=="23232")) AS y_count count(eval(Event_Name=="2323")) AS z_count
| table _time, x_count, y_count, z_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Feb 2019 01:15:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442646#M125640</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-02T01:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a multisearch query with the dedup command in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442647#M125641</link>
      <description>&lt;P&gt;(index=x “32432”) OR (index=y “23232”) OR (index=z “2323”) “client” | spath "EventStreamData.eventName" | rename "EventStreamData.eventName" as "Event_Name" |spath "EventStreamData.args.id" as "Id"| eval new_id= if(Event_Name==“2323”,Id,NULL)&lt;BR /&gt;
  | timechart span=1h count(eval(Event_Name==“32432”)) as x_count count(eval(Event_Name==“23232”)) as y_count dc(new_id) as z_count&lt;BR /&gt;
  | table _time, x_count, y_count, z_count&lt;/P&gt;

&lt;P&gt;This worked. But dedup and dc doesn't give same numbers for some reason. Difference is not huge, it's something like dedup giving 1458 vs dc giving 1471. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442647#M125641</guid>
      <dc:creator>amdhindsa</dc:creator>
      <dc:date>2020-09-29T23:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a multisearch query with the dedup command in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442648#M125642</link>
      <description>&lt;P&gt;This doesn't work because all the indexes doesn't have this field - "EventStreamData.args.id". If I add dedup then x and z counts comes as 0 and y has right count.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 22:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-a-multisearch-query-with-the-dedup-command-in-a/m-p/442648#M125642</guid>
      <dc:creator>amdhindsa</dc:creator>
      <dc:date>2019-02-05T22:51:48Z</dc:date>
    </item>
  </channel>
</rss>

