<?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: Display in range data based on application time taken in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-in-range-data-based-on-application-time-taken/m-p/542763#M153751</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/46853"&gt;@asharmaeqfx&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rangemap should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...
| sort 0 _time
| rangemap field=frontEndLatency "1. &amp;lt;4.5 seconds"=0-4.4 "2. &amp;lt;5.5 seconds"=4.5-5.5 "3. &amp;lt;7.5 seconds"=5.6-7.4 "4. &amp;lt;25 seconds"=7.5-24.9 default="5. &amp;gt;=30 seconds"
| streamstats avg(frontEndLatency) as avg_frontEndLatency by range
| stats last(avg_frontEndLatency) as avg_frontEndLatency count by range
| accum count as subtotal
| eventstats sum(count) as total
| eval percent=100*subtotal/total
| table range percent avg_frontEndLatency count
| rename range as "Product 1 Seconds", percent as "Cumulative repsonse %", avg_frontEndLatency as "Running Avg", count as "Volume of transactions"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unsure of your intent with respect to running averages, but I've included an example split by range that assumes ascending _time order is the correct sequence.&lt;/P&gt;&lt;P&gt;I've add "1.," "2.," "3.," ... prefixes to the range names, so they'll sort correctly after stats.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 00:32:04 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2021-03-08T00:32:04Z</dc:date>
    <item>
      <title>Display in range data based on application time taken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-range-data-based-on-application-time-taken/m-p/541293#M153250</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to display the data&lt;/P&gt;&lt;P&gt;Product 1&lt;BR /&gt;Seconds&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cumulative response %&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;running average&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Volume of transactions&lt;BR /&gt;&amp;lt;4.5 seconds&lt;BR /&gt;&amp;lt;5.5 seconds&lt;BR /&gt;&amp;lt;7.5 seconds&lt;BR /&gt;&amp;lt;25 seconds&lt;BR /&gt;&amp;gt;=30 seconds&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;&lt;P&gt;Based on the below post i actually wrote the same thing and it works till 10 sec but not the same way as listed&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Grouping-by-numeric-range/m-p/27498" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Grouping-by-numeric-range/m-p/27498&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query looks like&lt;/P&gt;&lt;P&gt;.....Search Query..... | eval frontEndLatency=frontEndLatency/1000 | sort 0 frontEndLatency | eventstats count as total | eval in_range=round(case(frontEndLatency&amp;lt;30, floor(2*frontEndLatency)/2+.5, frontEndLatency&amp;lt;10, ceil(frontEndLatency), frontEndLatency&amp;gt;=30,30.0),1)&lt;BR /&gt;| streamstats count as cnt avg(frontEndLatency) as run_avg&lt;BR /&gt;| stats first(total) as total last(run_avg) as run_avg max(cnt) as count count as cnt by in_range,product&lt;BR /&gt;| sort 0 in_range | eval range=if(frontEndLatency&amp;gt;=30, "&amp;gt;= 30.0 sec","&amp;lt; "+tostring(in_range)+" sec")&lt;BR /&gt;| eval pct=round(count/total*100,1)&lt;BR /&gt;| eval run_avg=round(run_avg,1)&lt;BR /&gt;| rename cnt as "Volume of Transactions" pct as "**bleep**. response %" run_avg as "Running Avg" | dedup range&lt;BR /&gt;| table range "**bleep**. response %" "Running Avg" "Volume of Transactions" | where range ="&amp;lt; 4.5 sec" OR range ="&amp;lt; 5.5 sec" OR range ="&amp;lt; 7.5 sec" OR range ="&amp;lt; 25.0 sec" OR range="&amp;lt; 30.0 sec"&lt;/P&gt;&lt;P&gt;It gives me the output as&lt;/P&gt;&lt;P&gt;range **bleep**. response % Running Avg Volume of Transactions&lt;BR /&gt;&amp;lt; 4.5 sec 4.7 1.3 2&lt;BR /&gt;&amp;lt; 5.5 sec 7.3 1.7 10&lt;BR /&gt;&amp;lt; 7.5 sec 26.5 2.8 21&lt;/P&gt;&lt;P&gt;But it does not gives the same table and thus i tried changing&amp;nbsp;&lt;/P&gt;&lt;P&gt;floor(4*frontEndLatency)/2+.5&lt;/P&gt;&lt;P&gt;or&amp;nbsp;floor(8*frontEndLatency)/2+.5 and it gives me the table but wrong figures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly advise as I am unable to understand what exactly is happening here? Also I tried rangemap but its not working.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 03:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-range-data-based-on-application-time-taken/m-p/541293#M153250</guid>
      <dc:creator>asharmaeqfx</dc:creator>
      <dc:date>2021-02-25T03:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Display in range data based on application time taken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-in-range-data-based-on-application-time-taken/m-p/542763#M153751</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/46853"&gt;@asharmaeqfx&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rangemap should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;...
| sort 0 _time
| rangemap field=frontEndLatency "1. &amp;lt;4.5 seconds"=0-4.4 "2. &amp;lt;5.5 seconds"=4.5-5.5 "3. &amp;lt;7.5 seconds"=5.6-7.4 "4. &amp;lt;25 seconds"=7.5-24.9 default="5. &amp;gt;=30 seconds"
| streamstats avg(frontEndLatency) as avg_frontEndLatency by range
| stats last(avg_frontEndLatency) as avg_frontEndLatency count by range
| accum count as subtotal
| eventstats sum(count) as total
| eval percent=100*subtotal/total
| table range percent avg_frontEndLatency count
| rename range as "Product 1 Seconds", percent as "Cumulative repsonse %", avg_frontEndLatency as "Running Avg", count as "Volume of transactions"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unsure of your intent with respect to running averages, but I've included an example split by range that assumes ascending _time order is the correct sequence.&lt;/P&gt;&lt;P&gt;I've add "1.," "2.," "3.," ... prefixes to the range names, so they'll sort correctly after stats.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 00:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-in-range-data-based-on-application-time-taken/m-p/542763#M153751</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-03-08T00:32:04Z</dc:date>
    </item>
  </channel>
</rss>

