<?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 increase subsearch limit? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636477#M221040</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252797"&gt;@Vivekmishra01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could configure a different limit for subsearches (by default 50,000) but it isn't a best practice, but anyway you could filter your results using the common field, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index="sample_index" "Kubernetes.namespace"="ABC" ("Two String" OR "Success work done")
| eval kind=if(search_match("Two String"),"Two String","Success work done")
| stats dc(kind) AS kind_count values(marksObtained) AS marksObtained BY  demo_id
| where kind_count=2
| mvexpand marksObtained 
| stats count AS Result BY marksObtained&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2023 07:13:39 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-03-29T07:13:39Z</dc:date>
    <item>
      <title>How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636410#M221022</link>
      <description>&lt;P&gt;I am trying to run a query like below but I am limited to 10000 sub search result. Is there a way to make this query run for more than 10000 sub search result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index="sample_index" "Kubernetes.namespace"="ABC" "Two String" [index="sample_index" "Kubernetes.namespace"="ABC" "Success work done" | fields demo_id ] | stats count as Result by marksObtained&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I saw someone has already asked a similar question &lt;A href="https://community.splunk.com/t5/Splunk-Search/Is-there-an-alternative-to-subsearch-or-a-way-to-raise-the/m-p/121586" target="_self"&gt;here&lt;/A&gt;, and I tried implementing it in the same way, but it's not working for me.&amp;nbsp; Below is the query which I wrote, but results are not as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="sample_index" "Kubernetes.namespace"="ABC" ("Two String"  OR "Success work done") | stats count as Result by marksObtained&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 21:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636410#M221022</guid>
      <dc:creator>Vivekmishra01</dc:creator>
      <dc:date>2023-03-28T21:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636416#M221026</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252797"&gt;@Vivekmishra01&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Both events must contain the&amp;nbsp;&lt;STRONG&gt;marksObtained&lt;/STRONG&gt; field must be in both events for the stats command group by to work.&lt;BR /&gt;&lt;BR /&gt;If you provide examples of both types of event data&amp;nbsp;&amp;nbsp;("Two String" OR "Success work done") then we might be able to assist in getting this working for you.&lt;BR /&gt;&lt;BR /&gt;Please obfuscate any sensitive data.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 22:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636416#M221026</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-28T22:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636424#M221030</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;The inner subquery don't have "marksObtained" but both the query has common field demo_id&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 22:55:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636424#M221030</guid>
      <dc:creator>Vivekmishra01</dc:creator>
      <dc:date>2023-03-28T22:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636427#M221031</link>
      <description>&lt;P&gt;OK, if both events have the demo_id field that tie the events together, then that is what you should use as the group by "key".&amp;nbsp; So, something like this should work...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="sample_index" "Kubernetes.namespace"="ABC" ("Two String"  OR "Success work done")
| stats count AS Result max(marksObtained) BY demo_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note, the max(marksObtained) assumes the the values is a number, not a a string.&amp;nbsp; Use values(marksObtained) if it is a string value.&lt;BR /&gt;&lt;BR /&gt;Hope that helps&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 23:11:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636427#M221031</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-28T23:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636429#M221032</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Outer query result will be like below and this is demo_id="&lt;EM&gt;64236fa4c43595ajj4eudhjjsh344,0ohf430765235178&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"log":"2023-03-28 22:52:20.504  INFO [my-application-web,64236fa4c43595ajj4eudhjjsh344,0ohf430765235178] 1 --- [nio-1892-exec-4] j.c.o.m.t.c.NotificationEventsController : Two Strings  marksObtained=A, ,"Kubernetes.node":"sample-node","Kubernetes.pod":"sample-pod","Kubernetes.namespace":"ABC","hostname":"demo_name"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Inner query Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"log":"2023-03-28 22:50:14.534  INFO [my-application-web,64236fa4c43595ajj4eudhjjsh344,0ohf430765235178] 1 --- [nio-1892-exec-4] c.j.c.o.m.t.s.AlertsKafkaProducer        : Success work done","Kubernetes.node":"sample-node","Kubernetes.pod":"sample-pod","Kubernetes.namespace":"ABC","hostname":"demo_name"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;marksObtained will have only three value "A", "B" and "C"&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 23:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636429#M221032</guid>
      <dc:creator>Vivekmishra01</dc:creator>
      <dc:date>2023-03-28T23:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636431#M221033</link>
      <description>&lt;P&gt;I am trying to count number of&amp;nbsp; "A", "B" and "C".&amp;nbsp; So, I think it must be BY "marksObtained". demo_id will be more than 10000.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 23:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636431#M221033</guid>
      <dc:creator>Vivekmishra01</dc:creator>
      <dc:date>2023-03-28T23:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636434#M221034</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252797"&gt;@Vivekmishra01&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, based on your sample data this should work...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummy
| append [| makeresults
| eval data="{\"log\":\"2023-03-28 22:52:20.504  INFO [my-application-web,64236fa4c43595ajj4eudhjjsh344,0ohf430765235178] 1 --- [nio-1892-exec-4] j.c.o.m.t.c.NotificationEventsController : Two Strings  marksObtained=A\",\"Kubernetes.node\":\"sample-node\",\"Kubernetes.pod\":\"sample-pod\",\"Kubernetes.namespace\":\"ABC\",\"hostname\":\"demo_name\"}|{\"log\":\"2023-03-28 22:50:14.534  INFO [my-application-web,64236fa4c43595ajj4eudhjjsh344,0ohf430765235178] 1 --- [nio-1892-exec-4] c.j.c.o.m.t.s.AlertsKafkaProducer        : Success work done\",\"Kubernetes.node\":\"sample-node\",\"Kubernetes.pod\":\"sample-pod\",\"Kubernetes.namespace\":\"ABC\",\"hostname\":\"demo_name\"}"
| makemv data delim="|"
| mvexpand data ]
| rename data AS _raw
| tojson
| spath
``` ignore above, just used to create dummy events ```
| rex field=log ",(?&amp;lt;demo_id&amp;gt;[^\]]+)(.*=(?&amp;lt;marksObtained&amp;gt;\w+))*"   ``` may not need this rex if field values already extracted ```
| stats count AS Result values(marksObtained) AS marksObtained BY demo_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 23:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636434#M221034</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-28T23:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636435#M221035</link>
      <description>&lt;P&gt;You will not hit the 10000 limit because you do not need to use the inefficient and limited subsearch to get your result.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;And, to find the distinct count (dc) of&amp;nbsp;&lt;SPAN&gt;"A", "B" and "C" just add this to the end of the query provided above&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;|&amp;nbsp; stats dc(marksObtained) AS tally_marksObtained&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 23:52:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636435#M221035</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-28T23:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636477#M221040</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252797"&gt;@Vivekmishra01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could configure a different limit for subsearches (by default 50,000) but it isn't a best practice, but anyway you could filter your results using the common field, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index="sample_index" "Kubernetes.namespace"="ABC" ("Two String" OR "Success work done")
| eval kind=if(search_match("Two String"),"Two String","Success work done")
| stats dc(kind) AS kind_count values(marksObtained) AS marksObtained BY  demo_id
| where kind_count=2
| mvexpand marksObtained 
| stats count AS Result BY marksObtained&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 07:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/636477#M221040</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-29T07:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/638387#M221253</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;It worked for me for up to last 48 hours.&amp;nbsp; But as I am increasing the time I see some inconsistencies in data. I believe splunk logs are dropping or something like that. Can you explain me below why you did it like that.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stats dc(kind) AS kind_count values(marksObtained) AS marksObtained BY  demo_id
| where kind_count=2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 14:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/638387#M221253</guid>
      <dc:creator>Vivekmishra01</dc:creator>
      <dc:date>2023-04-03T14:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase subsearch limit?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/638412#M221260</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252797"&gt;@Vivekmishra01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;with the eval before the stats I defined events,&lt;/P&gt;&lt;P&gt;then in the stats I categorized events using the variable in eval.&lt;/P&gt;&lt;P&gt;using the where condition I take only the events with both the events.&lt;/P&gt;&lt;P&gt;Maybe there's some inconsistence because there's one of the two kind of events outside the time period, but they should be very few.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 15:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-increase-subsearch-limit/m-p/638412#M221260</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-03T15:37:25Z</dc:date>
    </item>
  </channel>
</rss>

