<?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: Calculating IIS Events In Progress over Time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601196#M209248</link>
    <description>&lt;P&gt;This line puts _time into 1 second buckets, i.e. this is the same as doing eval _time=floor(_time) - it removes the milliseconds&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin span=1s _time&lt;/LI-CODE&gt;&lt;P&gt;Sort the events by _time - there could be (and in fact are in your data) multiple events for the same second&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort 0 _time&lt;/LI-CODE&gt;&lt;P&gt;Generate a running total of start events and end events&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count(eval(row=0)) as starts count(eval(row=1)) as ends&lt;/LI-CODE&gt;&lt;P&gt;In progress is the difference between start events and end events so far for any particular event&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval inprogress=starts-ends&lt;/LI-CODE&gt;&lt;P&gt;Where there are multiple events for the same second, we are only interested in the last value. &lt;STRONG&gt;Note that this is a change to the solution I proposed.&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats last(inprogress) as inprogress by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2022 14:03:42 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-06-09T14:03:42Z</dc:date>
    <item>
      <title>How to calculate IIS Events In Progress over Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601092#M209219</link>
      <description>&lt;P&gt;Our IIS logs contain a "time_taken" field which indicates the number of milliseconds each event took. I'd like to use the data from this field, along with the actual event _time (what I'm thinking of as the time the server responded, or the "responseTime") to create a chart showing how many events were "in progress" over time. It's easy enough to calculate the "requestTime" by doing something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eval requestTime = _time - time_taken&lt;/P&gt;
&lt;P&gt;What I'm missing is how to generate a graph with time (to the second) along the X-axis and total number of events in progress at that time on the Y-axis. For example, if a request was logged at 12:00:06 pm and had a time_taken of 3,000 ms (thus the "requestTime" was 12:00:03), then I would want it to be counted in 4 columns: 12:00:03, 12:00:04, 12:00:05, 12:00:06, indicating that this request was "in progress" during each of those times.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially, I want something like the output of the command below, but I want it to be a count of all events in progress during each of those seconds rather than just a discreet count of events based on their "_time"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; timechart count span=1s&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 05:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601092#M209219</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-10T05:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601104#M209222</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval requestTime=_time-time_taken
| eval row=mvrange(0,2) 
| mvexpand row
| eval _time=if(row=0,requestTime,_time)
| bin span=1s _time
| sort 0 _time
| streamstats count(eval(row=0)) as starts count(eval(row=1)) as ends
| eval inprogress=starts-ends
| table _time inprogress&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Jun 2022 04:08:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601104#M209222</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T04:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601150#M209228</link>
      <description>&lt;P&gt;Thanks, but that doesn't seem quite right. The results I get start with 1 event and increment the "inprogress" event count by 1 every second:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="inprogress.png" style="width: 57px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20020i011B39761DECD32C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inprogress.png" alt="inprogress.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601150#M209228</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T09:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601154#M209229</link>
      <description>&lt;P&gt;If time_taken is in milliseconds, try it like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval requestTime=_time-(time_taken/1000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;_time is in seconds&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:17:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601154#M209229</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T09:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601158#M209231</link>
      <description>&lt;P&gt;Thank you - that's starting to look better. Still a few oddities, though - when I select a 1 minute time range (in this case 5:00:00 - 5:01:00), the X-axis on the resulting table goes from 04:59:54 to 05:00:12 - why is that?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inprogress2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20021i7545428E52B33BA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="inprogress2.png" alt="inprogress2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp; each of the vertical bars in the chart appears to contain 2 sections, and only 1 of those can be selected when I mouseOver it. See in the image above that the bar for 5:00:02 clearly crosses over the 500 line, but when I mouseOver it, only the lower part of the bar is highlighted and the number listed of 471. Why?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inprogress3.png" style="width: 772px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20022iA626E32EFA817593/image-size/large?v=v2&amp;amp;px=999" role="button" title="inprogress3.png" alt="inprogress3.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601158#M209231</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601161#M209232</link>
      <description>&lt;P&gt;What search did you use to create these stats?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601161#M209232</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T10:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601162#M209233</link>
      <description>&lt;P&gt;host="myHost" source="*W3SVC1\\*"&lt;BR /&gt;| eval requestTime=_time-(time_taken/1000)&lt;BR /&gt;| eval row=mvrange(0,2)&lt;BR /&gt;| mvexpand row&lt;BR /&gt;| eval _time=if(row=0,requestTime,_time)&lt;BR /&gt;| bin span=1s _time&lt;BR /&gt;| sort 0 _time&lt;BR /&gt;| streamstats count(eval(row=0)) as starts count(eval(row=1)) as ends&lt;BR /&gt;| eval inprogress=starts-ends&lt;BR /&gt;| table _time inprogress&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601162#M209233</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T10:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601164#M209234</link>
      <description>&lt;P&gt;The time goes back because _time is reset to the time that the request started so that the inprogress count can be done.&lt;/P&gt;&lt;P&gt;There shouldn't be two parts to the bars. Can you share the stats table?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601164#M209234</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T10:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601167#M209235</link>
      <description>&lt;P&gt;Sure - here are 2 examples:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inprogress4.png" style="width: 981px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20023i7A70BB8DBB38C459/image-size/large?v=v2&amp;amp;px=999" role="button" title="inprogress4.png" alt="inprogress4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inprogress5.png" style="width: 954px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20024iA7E3C34E3A60B186/image-size/large?v=v2&amp;amp;px=999" role="button" title="inprogress5.png" alt="inprogress5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:40:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601167#M209235</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T10:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601172#M209239</link>
      <description>&lt;P&gt;You have multiple lines for the same time - try adding this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(inprogress) as inprogress by _time&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Jun 2022 11:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601172#M209239</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T11:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601190#M209246</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you - I think that's giving me what I want now! Would you mind explaining it a little? I see that it creates a multivalue field called row that is 0 or 1. It then expands that field to create new events for these values, yes? For row 0, it uses the requestTime and for row 1 it uses the _time.&amp;nbsp; That's about where I get lost.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here's the final search that I used:&lt;/P&gt;&lt;PRE&gt;host="myHost" source="*W3SVC1\\*"&lt;BR /&gt;| eval requestTime=_time-(time_taken/1000)&lt;BR /&gt;| eval row=mvrange(0,2) &lt;BR /&gt;| mvexpand row&lt;BR /&gt;| eval _time=if(row=0,requestTime,_time)&lt;BR /&gt;| bin span=1s _time&lt;BR /&gt;| sort 0 _time&lt;BR /&gt;| streamstats count(eval(row=0)) as starts count(eval(row=1)) as ends&lt;BR /&gt;| eval inprogress=starts-ends&lt;BR /&gt;| stats max(inprogress) as inprogress by _time&lt;BR /&gt;| table _time inprogress&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;And here's the output that I'm seeing now, which so far seems perfect:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inprogress6.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20026i16BE9D86D5963A4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="inprogress6.png" alt="inprogress6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:15:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601190#M209246</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601196#M209248</link>
      <description>&lt;P&gt;This line puts _time into 1 second buckets, i.e. this is the same as doing eval _time=floor(_time) - it removes the milliseconds&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin span=1s _time&lt;/LI-CODE&gt;&lt;P&gt;Sort the events by _time - there could be (and in fact are in your data) multiple events for the same second&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort 0 _time&lt;/LI-CODE&gt;&lt;P&gt;Generate a running total of start events and end events&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count(eval(row=0)) as starts count(eval(row=1)) as ends&lt;/LI-CODE&gt;&lt;P&gt;In progress is the difference between start events and end events so far for any particular event&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval inprogress=starts-ends&lt;/LI-CODE&gt;&lt;P&gt;Where there are multiple events for the same second, we are only interested in the last value. &lt;STRONG&gt;Note that this is a change to the solution I proposed.&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats last(inprogress) as inprogress by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 14:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601196#M209248</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-09T14:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating IIS Events In Progress over Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601199#M209250</link>
      <description>&lt;P&gt;Very helpful - I appreciate it very much. I've implemented the change that you proposed and I'm testing it now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 14:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-IIS-Events-In-Progress-over-Time/m-p/601199#M209250</guid>
      <dc:creator>rstankus</dc:creator>
      <dc:date>2022-06-09T14:07:18Z</dc:date>
    </item>
  </channel>
</rss>

