<?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: multiple searches for stats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580031#M202103</link>
    <description>&lt;P&gt;This returns an empty field&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kishan2356_0-1641401790685.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17417i314987358313529B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kishan2356_0-1641401790685.png" alt="kishan2356_0-1641401790685.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 16:56:37 GMT</pubDate>
    <dc:creator>kishan2356</dc:creator>
    <dc:date>2022-01-05T16:56:37Z</dc:date>
    <item>
      <title>multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580024#M202101</link>
      <description>&lt;P&gt;I have two searches where I need to run an stats count on to do some calculations. First search&amp;nbsp; is&lt;/P&gt;&lt;P&gt;index=xxx wf_id=xxx wf_env=xxx xxx | stats count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second search is&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=xxx wf_id=xxx wf_env=xxx&amp;nbsp; &amp;nbsp; sourcetype=xxx usecase=xxx&amp;nbsp; | stats count by request_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First search uses a simple stats to get its count, but the second search uses stats count by request_id so I am having trouble getting the counts for both. Ideally I would like to get the counts for both searches and divide them. I've used appendcols but it returns empty fields for both searches. Any guidance on how to get counts for these searches would be helpful!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working example:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="156"&gt;&lt;P&gt;_time&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;Search 1 counts&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;Search 2 counts&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;Search 1/ Search 2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="156"&gt;&lt;P&gt;00:30&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;50&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;25&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="156"&gt;&lt;P&gt;00:35&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;100&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;25&lt;/P&gt;&lt;/TD&gt;&lt;TD width="156"&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580024#M202101</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2022-01-05T16:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580029#M202102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/212839"&gt;@kishan2356&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried appendpipe?&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx wf_id=xxx wf_env=xxx sourcetype=xxx usecase=xxx
| stats count by request_id
| appendpipe [ search index=xxx wf_id=xxx wf_env=xxx xxx | stats count  rename count AS total ]
| eval perc=count/total&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580029#M202102</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-05T16:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580031#M202103</link>
      <description>&lt;P&gt;This returns an empty field&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kishan2356_0-1641401790685.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17417i314987358313529B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kishan2356_0-1641401790685.png" alt="kishan2356_0-1641401790685.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580031#M202103</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2022-01-05T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580032#M202104</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/212839"&gt;@kishan2356&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in my test I have two rows: one with empty field and one with the valued fiel, you could filter for the fields with the value:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx wf_id=xxx wf_env=xxx sourcetype=xxx usecase=xxx
| stats count by request_id
| appendpipe [ search index=xxx wf_id=xxx wf_env=xxx xxx | stats count | rename count AS total ]
| search total=*
| eval perc=count/total&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 17:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580032#M202104</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-05T17:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580489#M202236</link>
      <description>&lt;P&gt;Thank you for the reply&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hi am still getting black fields when using appendpipe.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580489#M202236</guid>
      <dc:creator>kishan2356</dc:creator>
      <dc:date>2022-01-10T16:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: multiple searches for stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580494#M202238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/212839"&gt;@kishan2356&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx wf_id=xxx wf_env=xxx sourcetype=xxx usecase=xxx
| bin _time span=5m
| stats count by _bin request_id
| append [ search 
   index=xxx wf_id=xxx wf_env=xxx xxx 
   | bin _time span=5m 
   | stats count BY _time 
   | rename count AS total 
   ]
| stats sum(count) AS count values(total) AS total BY _time
| eval perc=count/total&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 17:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-searches-for-stats/m-p/580494#M202238</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-10T17:27:51Z</dc:date>
    </item>
  </channel>
</rss>

