<?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 use multiple search results in another search to get my expected output? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251969#M75341</link>
    <description>&lt;P&gt;Hi Sundaresh,&lt;BR /&gt;
I have one more question if you are ok with that.&lt;BR /&gt;
Requirement is:&lt;BR /&gt;
statement1: index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| where csuri="/pages/default.aspx" AND  sc_status!="401"|stats  count(eval(time_taken&amp;gt;4000)) as "Page Views &amp;gt; 4 seconds" count(eval(time_taken&amp;gt;2500))  as "Page Views &amp;gt; 2.5 seconds" | appendcols[search index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| Where csuri="/view/pages/default.aspx" AND  sc_status!="401"|stats avg(time_taken) as "Page response time", count as "Page views"]&lt;/P&gt;

&lt;P&gt;statement2: index=main sourcetype=iis|eval resultvalue= (Page Views &amp;gt; 4 seconds/Page Views) *100.&lt;/P&gt;

&lt;P&gt;I am looking all 2 statements into single statement to get the result. In above answer we have looked one condition across statement. But here we can find various conditions across all 2 statements. &lt;/P&gt;

&lt;P&gt;Please help me on this if you have any idea?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;BR /&gt;
Guru Prasad K&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:43:19 GMT</pubDate>
    <dc:creator>guruwells</dc:creator>
    <dc:date>2020-09-29T09:43:19Z</dc:date>
    <item>
      <title>How to use multiple search results in another search to get my expected output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251965#M75337</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have 2 search statements which are giving 2 different search results with same index and sourcetype. I want to use these results in another search statement and need to get the result.&lt;/P&gt;

&lt;P&gt;1st search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=iis| where time_taken &amp;gt; 4000 |stats count(s_computername) as "# of Hits &amp;gt; 4 seconds"| 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2nd search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=iis| eval u_name =replace(cs_username, "0#","")| eval u_name1= replace(u_name, ".w|","")|eval u_name2=replace(u_name1,"\|","")|stats dc(u_name2) AS "Unique Users", count(s_computername) as "Elements/Hits"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And looking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= main sourcetype=iis| eval result= "# of Hits &amp;gt; 4 seconds" / Elements/Hits| eval resultvalue= result * 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using &lt;CODE&gt;appendcols&lt;/CODE&gt; to get the results from various search statements.&lt;/P&gt;

&lt;P&gt;Your help is appreciated.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Guru&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 11:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251965#M75337</guid>
      <dc:creator>guruwells</dc:creator>
      <dc:date>2016-05-17T11:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple search results in another search to get my expected output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251966#M75338</link>
      <description>&lt;P&gt;You could try without the subsearch like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=iis | eval u_name =replace(cs_username, "0#","") | eval u_name1= replace(u_name, ".w|","") | eval u_name2=replace(u_name1,"\|","") | stats count(eval(time_taken&amp;gt;4000)) AS hits dc(u_name2) as users count(s_computername) AS elements  | eval resultsvalue = (hits/elements)*100 | rename hits AS "# of Hits &amp;gt; 4 seconds" elements AS  "Elements/Hits"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 May 2016 13:27:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251966#M75338</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-17T13:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple search results in another search to get my expected output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251967#M75339</link>
      <description>&lt;P&gt;Excellent. it's worked for me. Thanks for the help. It's saved lot of time.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 13:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251967#M75339</guid>
      <dc:creator>guruwells</dc:creator>
      <dc:date>2016-05-17T13:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple search results in another search to get my expected output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251968#M75340</link>
      <description>&lt;P&gt;How to fulfill below requirement in single satement.&lt;BR /&gt;
satement1: &lt;BR /&gt;
index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| where csuri="/pages/default.aspx" AND  sc_status!="401"|stats  count(eval(time_taken&amp;gt;4000)) as "Page Views &amp;gt; 4 seconds" count(eval(time_taken&amp;gt;2500))  as "Page Views &amp;gt; 2.5 seconds"&lt;BR /&gt;
statement2:&lt;BR /&gt;
appendcols[search index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| Where csuri="/view/pages/default.aspx" AND  sc_status!="401"|stats avg(time_taken) as "Page response time" |stats count as "Page views"]&lt;/P&gt;

&lt;P&gt;statement3: index= main sourcetype=iis |eval resultset= (Page Views&amp;gt; 4 seconds"/"Page Views") *100.&lt;/P&gt;

&lt;P&gt;In above answer it's really helped I got the output accordingly. But here couples of conditions are exist. How to make these 3 statements into single search statement.&lt;/P&gt;

&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251968#M75340</guid>
      <dc:creator>guruwells</dc:creator>
      <dc:date>2020-09-29T09:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use multiple search results in another search to get my expected output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251969#M75341</link>
      <description>&lt;P&gt;Hi Sundaresh,&lt;BR /&gt;
I have one more question if you are ok with that.&lt;BR /&gt;
Requirement is:&lt;BR /&gt;
statement1: index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| where csuri="/pages/default.aspx" AND  sc_status!="401"|stats  count(eval(time_taken&amp;gt;4000)) as "Page Views &amp;gt; 4 seconds" count(eval(time_taken&amp;gt;2500))  as "Page Views &amp;gt; 2.5 seconds" | appendcols[search index=main sourcetype=iis earliest=-1d@d|eval csuri=lower(cs_uri_stem)| Where csuri="/view/pages/default.aspx" AND  sc_status!="401"|stats avg(time_taken) as "Page response time", count as "Page views"]&lt;/P&gt;

&lt;P&gt;statement2: index=main sourcetype=iis|eval resultvalue= (Page Views &amp;gt; 4 seconds/Page Views) *100.&lt;/P&gt;

&lt;P&gt;I am looking all 2 statements into single statement to get the result. In above answer we have looked one condition across statement. But here we can find various conditions across all 2 statements. &lt;/P&gt;

&lt;P&gt;Please help me on this if you have any idea?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;BR /&gt;
Guru Prasad K&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:43:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-multiple-search-results-in-another-search-to-get-my/m-p/251969#M75341</guid>
      <dc:creator>guruwells</dc:creator>
      <dc:date>2020-09-29T09:43:19Z</dc:date>
    </item>
  </channel>
</rss>

