<?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 to replace subsearch to achieve the same result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590428#M205564</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Folks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm using a query like below. But since subsearch returns more than 10K events, I'm not getting the expected result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone advise me if there is an alternate way to replace subsearch and to achieve the expected result?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index="foo" sourcetype="xyz" user!="abc" method=POST (url="*search*aspx*" AND code!=302 AND code!=304 AND code!=401 AND code!=403 AND code!=0) [search index="foo" method_name=pqr message="*Response Time for method pqr*" | fields uniqid]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval hour=strftime(_time,"%H") | where hour &amp;gt;=7 AND hour &amp;lt;=19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| timechart span=1d count(eval(time_took)) as Total ,&amp;nbsp;count(eval(time_took&amp;lt;2000)) as Success, count(eval(time_took&amp;gt;2000)) as misses | sort by "_time" desc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for the help.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 13:30:55 GMT</pubDate>
    <dc:creator>peterfox1992</dc:creator>
    <dc:date>2022-03-23T13:30:55Z</dc:date>
    <item>
      <title>How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590428#M205564</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Folks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm using a query like below. But since subsearch returns more than 10K events, I'm not getting the expected result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone advise me if there is an alternate way to replace subsearch and to achieve the expected result?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index="foo" sourcetype="xyz" user!="abc" method=POST (url="*search*aspx*" AND code!=302 AND code!=304 AND code!=401 AND code!=403 AND code!=0) [search index="foo" method_name=pqr message="*Response Time for method pqr*" | fields uniqid]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval hour=strftime(_time,"%H") | where hour &amp;gt;=7 AND hour &amp;lt;=19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| timechart span=1d count(eval(time_took)) as Total ,&amp;nbsp;count(eval(time_took&amp;lt;2000)) as Success, count(eval(time_took&amp;gt;2000)) as misses | sort by "_time" desc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for the help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 13:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590428#M205564</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T13:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590445#M205569</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="foo" (sourcetype="xyz" user!="abc" method=POST (url="*search*aspx*" AND code!=302 AND code!=304 AND code!=401 AND code!=403 AND code!=0) OR (method_name=pqr message="*Response Time for method pqr*")
| eval filterer=if(searchmatch(method_name=pqr) AND searchmatch(message="*Response Time for method pqr*"),1,null())
| eventstats values(filterer) as filtered by uniqid
| where filtered=1 AND isnull(filterer)
| eval hour=strftime(_time,"%H") | where hour &amp;gt;=7 AND hour &amp;lt;=19
| timechart span=1d count(eval(time_took)) as Total , count(eval(time_took&amp;lt;2000)) as Success, count(eval(time_took&amp;gt;2000)) as misses | sort by "_time" desc&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 14:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590445#M205569</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-23T14:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590455#M205571</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;for the reply.&lt;/P&gt;&lt;P&gt;I noticed few issues while running the query.&lt;/P&gt;&lt;P&gt;i) Open bracket before&amp;nbsp;sourcetype="xyz" May I know where should I need to close the bracket.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(sourcetype="xyz" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also getting below error in the eval command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'eval' command: The arguments to the 'searchmatch' function are invalid.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks once again.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590455#M205571</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T15:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590459#M205573</link>
      <description>&lt;P&gt;Try it like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="foo" (sourcetype="xyz" user!="abc" method=POST (url="*search*aspx*" AND code!=302 AND code!=304 AND code!=401 AND code!=403 AND code!=0)) OR (method_name=pqr message="*Response Time for method pqr*")
| eval filterer=if(match(method_name,"pqr") AND match(message,"Response Time for method pqr"),1,null())
| eventstats values(filterer) as filtered by uniqid
| where filtered=1 AND isnull(filterer)
| eval hour=strftime(_time,"%H") | where hour &amp;gt;=7 AND hour &amp;lt;=19
| timechart span=1d count(eval(time_took)) as Total , count(eval(time_took&amp;lt;2000)) as Success, count(eval(time_took&amp;gt;2000)) as misses | sort by "_time" desc&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590459#M205573</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-23T15:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590465#M205577</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, I tried but once again an error in eval.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'eval' command: Regex: quantifier does not follow a repeatable item&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590465#M205577</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T15:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590468#M205579</link>
      <description>&lt;P&gt;What exactly do you have in your eval command?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:33:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590468#M205579</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-23T15:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590499#M205588</link>
      <description>&lt;P&gt;This is the exact eval command which I'm using.&lt;/P&gt;&lt;P&gt;eval filterer=if(match(method_name,"pqr") AND match(message,"*Response Time for pqr*"),1,null())&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590499#M205588</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T17:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590502#M205590</link>
      <description>&lt;P&gt;Remove the * from the beginning and end of the match string (as I showed in my example!)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 16:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590502#M205590</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-23T16:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace subsearch to achieve the same result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590508#M205592</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Much Appreciate for you patience and guidance. Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-subsearch-to-achieve-the-same-result/m-p/590508#M205592</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T17:18:06Z</dc:date>
    </item>
  </channel>
</rss>

