<?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: Concurrent calls per minute in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494276#M194511</link>
    <description>&lt;P&gt;another solution is to directly use the makecontinuous, and tweak the concurrency calculation to correct the added events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makecontinuous _time span=1m |fillnull call_duration | concurrency duration=call_duration | eval concurrency=if(call_duration=0,concurrency-1,concurrency) |fields _time concurrency
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works well, but the chart ends a the beginning of the last call. Depending on your use case, this may be a problem or not.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 14:45:56 GMT</pubDate>
    <dc:creator>grundsch</dc:creator>
    <dc:date>2019-10-16T14:45:56Z</dc:date>
    <item>
      <title>Concurrent calls per minute</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494274#M194509</link>
      <description>&lt;P&gt;I'm trying to calculate the amount of concurrent calls per minute or another time span (e.g. 5 minutes, ...). I'm using the concurrency function to achieve that. There's one problem though: The function only considers events to calculate the amount of concurrent calls but I would like to sample every minute.&lt;/P&gt;

&lt;P&gt;My json records contain a &lt;STRONG&gt;_time&lt;/STRONG&gt; and a &lt;STRONG&gt;call_duration&lt;/STRONG&gt;. My current query looks as follows&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex source=test11 | fields + call_duration | fields - _raw | concurrency duration=call_duration | timechart max(concurrency) as "Simultaneous calls" span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The data is as follows:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7763iAC0739B2A51B427D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The resulting chart:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7764i8373A1B69231EFF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The concurrent calls from 7:10:00 to 7:11:00 would be 1 but are shown as 2, because no event occurs during that time. I can't add fake events because then there would be 1 call at that time. So is there a possibility to sample every minute with the concurrency call?&lt;BR /&gt;
The same effect happens from 7:20 to 7:30. There is only 1 call at that time but the graph shows 2, because of the surrounding data points.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 07:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494274#M194509</guid>
      <dc:creator>danielsuter</dc:creator>
      <dc:date>2019-10-09T07:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent calls per minute</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494275#M194510</link>
      <description>&lt;P&gt;One solution is to re-implement yourself a concurrency calculation. It involves creating an event when the call starts, and another when the call ends. Give the start a value of +1 and the end -1, and Streamstats will allow you to keep a running count of calls. Finally, with makecontinuous, you can fill the time stamps between "events" to get a visualisation of the actual concurrent calls.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval end_time=_time+call_duration| eval time=mvappend(_time,end_time) | mvexpand time | sort 0 time |eval start_stop=if(end_time=time,-1,1)|makecontinuous time span=1m|streamstats sum(start_stop) as concurent | eval _time=time | fields _time concurent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7762i8718667FD15C14B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 14:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494275#M194510</guid>
      <dc:creator>grundsch</dc:creator>
      <dc:date>2019-10-16T14:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent calls per minute</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494276#M194511</link>
      <description>&lt;P&gt;another solution is to directly use the makecontinuous, and tweak the concurrency calculation to correct the added events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makecontinuous _time span=1m |fillnull call_duration | concurrency duration=call_duration | eval concurrency=if(call_duration=0,concurrency-1,concurrency) |fields _time concurrency
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works well, but the chart ends a the beginning of the last call. Depending on your use case, this may be a problem or not.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 14:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concurrent-calls-per-minute/m-p/494276#M194511</guid>
      <dc:creator>grundsch</dc:creator>
      <dc:date>2019-10-16T14:45:56Z</dc:date>
    </item>
  </channel>
</rss>

