<?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: Can you help me write a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436990#M167671</link>
    <description>&lt;P&gt;hi @Rocky31,&lt;/P&gt;

&lt;P&gt;Did @DalJeanis answer your question? If so, please resolve this post by approving their answer below. If not, keep us updated so that someone else can help solve your problem.&lt;/P&gt;

&lt;P&gt;Also, if you're feeling generous, give out an upvote to the user that helped ya. Our users love them upvotes. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 22:10:33 GMT</pubDate>
    <dc:creator>mstjohn_splunk</dc:creator>
    <dc:date>2018-08-31T22:10:33Z</dc:date>
    <item>
      <title>Can you help me write a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436988#M167669</link>
      <description>&lt;P&gt;Firstly, i am trying to separate 1) cachekey=false in one query and 2) cachekey=true in another query and 3) with both combined in one query. Also i want avg response time and perc90 response time. Where i am facing difficulty is that count 1 and 2 combined is not equal to the count in query #3.  I don't know where it went wrong in the query. Experts please spare some time to pull me out of this. &lt;/P&gt;

&lt;P&gt;Below are the query how i wrote &lt;/P&gt;

&lt;P&gt;1) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=datapower CVSEVENT=EXIT opName="ABCD" status="SUCCESS" [search index=datapower opName=" 1234" cache ="false" | dedup grid | fields grid ]
| dedup grid
| table  respTime, grid | stats avg(respTime), perc90(respTime), count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=datapower  opName="ABCD" status="SUCCESS" [search index=datapower opName="1234" cache ="true" | dedup grid | fields grid ]
| dedup grid
| table  respTime, grid | stats avg(respTime), perc90(respTime), count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=datapower  opName="ABCD" OR  opName="1234" status="SUCCESS" |stats avg(respTime), perc90(respTime), count by opName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 03:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436988#M167669</guid>
      <dc:creator>Rocky31</dc:creator>
      <dc:date>2018-08-31T03:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me write a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436989#M167670</link>
      <description>&lt;P&gt;There's no reason those three would match. Let's take the trivial situation where there is one or two of each&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=datapower CVSEVENT=EVENT opName="ABCD" status="SUCCESS" grid=foo1 respTime=9
   index=datapower CVSEVENT=EVENT opName="ABCD" status="SUCCESS" grid=foo1 respTime=10  - DUP will be dropped
   index=datapower opName="1234" status="SUCCESS" grid=foo1 cache="true"
   index=datapower CVSEVENT=EVENT opName="ABCD" status="SUCCESS" grid=foo2 respTime=15
   index=datapower opName="1234" status="SUCCESS" grid=foo2 cache="true"
   index=datapower opName="ABCD" status="SUCCESS" grid=foo3 respTime=18
   index=datapower opName="1234" status="SUCCESS" grid=foo3 cache="false"

results 1
    avg=12 count=2

results 2
    avg=18 count=1

results 3
   opname="ABCD",avg=14,count=4
   opname="1234", count=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can try something like this for a consolidated report.  No guarantee on this one, because I don't know your data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=datapower opName="ABCD" status="SUCCESS") OR
(index=datapower opName="1234")
| fields opName grid CVSEVENT respTime cache
| dedup opName grid CVSEVENT respTime
| dedup opName grid cache
| stats values(*) as * by grid 

| stats avg(respTime) as avgResp p90(respTime) as p90Resp count by opName cache
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 05:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436989#M167670</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-31T05:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me write a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436990#M167671</link>
      <description>&lt;P&gt;hi @Rocky31,&lt;/P&gt;

&lt;P&gt;Did @DalJeanis answer your question? If so, please resolve this post by approving their answer below. If not, keep us updated so that someone else can help solve your problem.&lt;/P&gt;

&lt;P&gt;Also, if you're feeling generous, give out an upvote to the user that helped ya. Our users love them upvotes. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 22:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-write-a-subsearch/m-p/436990#M167671</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-08-31T22:10:33Z</dc:date>
    </item>
  </channel>
</rss>

