<?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 the concurrency command to timechart the top 10 concurrencies by field sourceip? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/533552#M150767</link>
    <description>&lt;P&gt;Great solution&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/103"&gt;@sideview&lt;/a&gt;&amp;nbsp;, I've been struggling with a split by concurrency problem a couple of days.&amp;nbsp; The concurrency command works fine when I just search for events with a single value used fot the split, when I search for all events with all "split by values" the numbers aren't right. I found out myself why, and thought it would be impossible. Your spooky bit of SPL solves it nicely, and running it line by line looking at the results I understand why. Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;My not correctly working code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mfpublic sourcetype=SMF030 SMF30JNM=JOB* SMF30CLS=*
| stats earliest(_time) as start latest(_time) as stop by SMF30JNM SMF30CLS
| eval _time=start, duration=stop-start
| concurrency duration=duration
| timechart limit=20 span=15m max(concurrency) by SMF30CLS&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the working code with your solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mfpublic sourcetype=SMF030 SMF30JNM=JOB* SMF30CLS=*
| stats earliest(_time) as start latest(_time) as stop by SMF30JNM SMF30CLS
| eval _time=start, duration=stop-start
| eval increment = mvappend("1","-1") 
| mvexpand increment 
| eval _time = if(increment==1, _time, _time + duration) 
| sort 0 + _time 
| fillnull class value="NULL" 
| streamstats sum(increment) as post_concurrency by SMF30CLS
| eval concurrency = if(increment==-1, post_concurrency+1, post_concurrency)
| timechart limit=0 span=15m max(concurrency) as max_concurrency last(post_concurrency) as last_concurrency by SMF30CLS
| filldown last_concurrency* 
| foreach "max_concurrency: *" [eval &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;=coalesce('max_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;','last_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;')] 
| fields - last_concurrency* max_concurrency*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
    <pubDate>Fri, 18 Dec 2020 10:06:54 GMT</pubDate>
    <dc:creator>Hoekb03</dc:creator>
    <dc:date>2020-12-18T10:06:54Z</dc:date>
    <item>
      <title>How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132495#M36145</link>
      <description>&lt;P&gt;I have the following event that needs to calculate concurrency:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event, starttime=yyyy-mm-dd hh:mm:ss, duration=, sourceip=a.b.c.d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to find out the concurrency of the Event based on &lt;CODE&gt;sourceip&lt;/CODE&gt;, I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "duration=(?.*?),"  | eval StartTime=round(strptime(startTime,"%Y-%m-%d %H:%M:%S"),0) | concurrency start=StartTime duration=Duration | timechart span=1m max(concurrency) by sourceip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But for some reason, it sums up the result for all &lt;CODE&gt;sourceip&lt;/CODE&gt; together. I'm wondering if I'm using the concurrency command correctly.&lt;/P&gt;

&lt;P&gt;Another task is that I would like to see just the top 10 concurrency by &lt;CODE&gt;sourceip&lt;/CODE&gt; in a timechart since there are so many sourceips, any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 19:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132495#M36145</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-09T19:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132496#M36146</link>
      <description>&lt;P&gt;Hi jgcsco&lt;BR /&gt;
To see just the top 10 concurrency by sourceip add limit=10 in your search like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | rex "duration=(?.*?),"  | eval StartTime=round(strptime(startTime,"%Y-%m-%d %H:%M:%S"),0) | concurrency start=StartTime duration=Duration | timechart  limit=10 span=1m max(concurrency) by sourceip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2015 20:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132496#M36146</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-04-09T20:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132497#M36147</link>
      <description>&lt;P&gt;well, the splunk is still not grouping the concurrency result by sourceip correctly, but rather a sum of them. Not sure if it is due to the large dataset. The souceip is around 1000 entries. The Duration is anywhere from 30min to 3hrs.  And at peak time, the total event count could reach 40K per minute. &lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 21:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132497#M36147</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-09T21:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132498#M36148</link>
      <description>&lt;P&gt;The concurrency command is no good when you want to split by a field like this.   The reason why the timechart isn't doing the right thing is that it's too late.  The concurrency command has already calculated only a global concurrency,   whereas what it  needs to do is calculate concurrency separately for each sourceip.   &lt;/P&gt;

&lt;P&gt;It took me a long time (years really) to find search language that could calculate concurrency by a split by field, both accurately and reasonably efficiently, and while it does exist, it's pretty advanced.    I'm assuming you already have fields called &lt;CODE&gt;StartTime&lt;/CODE&gt; and &lt;CODE&gt;Duration&lt;/CODE&gt; and &lt;CODE&gt;sourceip&lt;/CODE&gt;, and you want to tack this on the end: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time=StartTime
| eval increment = mvappend("1","-1") 
| mvexpand increment 
| eval _time = if(increment==1, _time, _time + Duration) 
| sort 0 + _time 
| fillnull sourceip value="NULL" 
| streamstats sum(increment) as post_concurrency by sourceip 
| eval concurrency = if(increment==-1, post_concurrency+1, post_concurrency)
| timechart bins=400 max(concurrency) as max_concurrency last(post_concurrency) as last_concurrency by sourceip 
| filldown last_concurrency* 
| foreach "max_concurrency: *" [eval &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;=coalesce('max_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;','last_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;')] 
| fields - last_concurrency* max_concurrency*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you're familiar with streamstats, the bits with the increment and the streamstats will be pretty clear - it is literally keeping a little record of each start and end, and incrementing/decrementing a separate counter for each value of sourceip.  &lt;/P&gt;

&lt;P&gt;When the timechart starts differentiating between last and max concurrency, you might wonder why. And then filldown and foreach get involved, things get pretty nutty.   the core problem there is that while computing the max concurrency per timebucket is easy, we &lt;EM&gt;also&lt;/EM&gt; need to preserve the last-known-concurrency value for each timebucket and sourceip,  or else our concurrency math gets a little inaccurate for the following buckets.   that's what that stuff is doing.  &lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 02:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132498#M36148</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-14T02:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132499#M36149</link>
      <description>&lt;P&gt;Thanks for working out the query, looking at the result, it really gives me what I want now. However, I am not sure I understand why use "bin=400", and "foreach" statement. &lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 14:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132499#M36149</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-14T14:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132500#M36150</link>
      <description>&lt;P&gt;the &lt;CODE&gt;bin&lt;/CODE&gt; is actually more of a personal preference. I usually find I want a &lt;EM&gt;bit&lt;/EM&gt; more granularity in my timecharts.  feel free to adjust that up or down.   The number specifies a ceiling for the number of timebuckets in the displayed timerange and timechart will come as close to that ceiling as it can.  Default is 100 and these are too chunky for my concurrency use cases.&lt;/P&gt;

&lt;P&gt;the purpose of the foreach,  yes, it's tied in with the very strange output from timechart (delete back so the timechart is the last clause and run it, then view as a table and you'll see what I mean).  The filldown does strange things to smear the last_concurrency... values through the earlier buckets, and the foreach is doing some peculiar logic to  put it all back together again and reconcile each sourceip's value of last concurrency and max concurrency so each bucket gets the right max concurrency value. &lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 15:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132500#M36150</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-14T15:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132501#M36151</link>
      <description>&lt;P&gt;Thanks sideview for the detailed response.  Besides the above result, I also want to take a look at the concurrency distribution to find out if it is matching a z-distribution.  I modify the query to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval StartTime=round(strptime(startTime,"%Y-%m-%dT%H:%M:%SZ"),0) 
|eval _time=StartTime 
| eval increment = mvappend("1","-1") 
| mvexpand increment 
| eval _time = if(increment==1, _time, _time + Duration) 
| sort 0 + _time 
| fillnull sourceId value="NULL" 
| streamstats sum(increment) as post_concurrency by sourceip 
| eval concurrency = if(increment==-1, post_concurrency+1, post_concurrency) 
| stats count(concurrency) by concurrency   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems giving me the data I want, but would like to get your opinion. I am not sure of the granularity of concurrency here, was it count it by second?  Both StartTime and Duration are down to second.  &lt;/P&gt;

&lt;P&gt;Is there a way to make concurrency as x-Axis, and count(concurrency) as y-Axis?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 23:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132501#M36151</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-15T23:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132502#M36152</link>
      <description>&lt;P&gt;I see what you're trying to do,  but I'm not sure  &lt;CODE&gt;| stats count(concurrency) by concurrency&lt;/CODE&gt; is the way to go about it.  That clause will just count the number of events that at some point have each individual integer value of concurrency.    It's &lt;EM&gt;close&lt;/EM&gt; to a working definition of a frequency distribution but I'm not sure it's what you want.    I'd want a frequency distribution of concurrency to have rows that are timebuckets of equal length. &lt;/P&gt;

&lt;P&gt;And it begs the question - do you want to see the frequency distribution of overall concurrency,  or of concurrency as split by the values of sourceIp? &lt;/P&gt;

&lt;P&gt;To be honest I think this is a separate question.  The answer and comment thread for this sub-question might get too complex.   We can just link the two questions together and it'll be more usable that way. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 17:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132502#M36152</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-16T17:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132503#M36153</link>
      <description>&lt;P&gt;I would like to see the frequency how of the same concurrency number happened, if two different sourceip show the same concurrency at certain point, then I would like to count it as two.  This is more like a statistic analysis for our traffic pattern. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 18:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132503#M36153</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-16T18:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132504#M36154</link>
      <description>&lt;P&gt;Understand completely and I still think it's a separate  question.  Also still think that an approach like "stats count by concurrency " is statistically suspect and going to skew your results significantly, not because the's anything wrong with that command, but the rows going into it do not fit the right asssumptions at all.   &lt;/P&gt;

&lt;P&gt;As a thumbnail sketch of what will, onto the very end of all the search language I listed,  you want to use the untable command like &lt;CODE&gt;untable _time sourceIp count&lt;/CODE&gt; to unwind the output down to rows that are each distinct combinations of time, sourceip, and that for each such combination has a concurrency number.   That's the set of rows you want to do this kind of analysis on.   From there yes you can do &lt;CODE&gt;stats count by concurrency&lt;/CODE&gt;  or if you want to bucket it,  &lt;CODE&gt;| bucket concurrency span=5 | stats count by concurrency | sort 0 - concurrency&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 20:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132504#M36154</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-16T20:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132505#M36155</link>
      <description>&lt;P&gt;sorry, just got back from a trip. Agree with you, this should be a separate question.  I have created a new one at: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/230633/how-to-calculate-concurrency-distribution.html"&gt;http://answers.splunk.com/answers/230633/how-to-calculate-concurrency-distribution.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Can you please link it? Since you know the history of the question, and have helped a lot. &lt;/P&gt;

&lt;P&gt;Thanks, and sorry for making complicating the question. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 23:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132505#M36155</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2015-04-21T23:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132506#M36156</link>
      <description>&lt;P&gt;This needs to become a core funtion in splunk.&lt;/P&gt;

&lt;P&gt;The amount of time I have wasted in concurrency until I found this was way to much.&lt;/P&gt;

&lt;P&gt;This now makes my "concurrency per host" problem disappear.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 01:17:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132506#M36156</guid>
      <dc:creator>terryrankine</dc:creator>
      <dc:date>2016-09-01T01:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132507#M36157</link>
      <description>&lt;P&gt;This is also useful for determining concurrency for a single series when you don't have enough data points to be particularly useful, because you're creating a data point at the "end" of the timeframe.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 21:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/132507#M36157</guid>
      <dc:creator>vbumgarner</dc:creator>
      <dc:date>2016-10-26T21:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/533552#M150767</link>
      <description>&lt;P&gt;Great solution&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/103"&gt;@sideview&lt;/a&gt;&amp;nbsp;, I've been struggling with a split by concurrency problem a couple of days.&amp;nbsp; The concurrency command works fine when I just search for events with a single value used fot the split, when I search for all events with all "split by values" the numbers aren't right. I found out myself why, and thought it would be impossible. Your spooky bit of SPL solves it nicely, and running it line by line looking at the results I understand why. Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;My not correctly working code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mfpublic sourcetype=SMF030 SMF30JNM=JOB* SMF30CLS=*
| stats earliest(_time) as start latest(_time) as stop by SMF30JNM SMF30CLS
| eval _time=start, duration=stop-start
| concurrency duration=duration
| timechart limit=20 span=15m max(concurrency) by SMF30CLS&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the working code with your solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mfpublic sourcetype=SMF030 SMF30JNM=JOB* SMF30CLS=*
| stats earliest(_time) as start latest(_time) as stop by SMF30JNM SMF30CLS
| eval _time=start, duration=stop-start
| eval increment = mvappend("1","-1") 
| mvexpand increment 
| eval _time = if(increment==1, _time, _time + duration) 
| sort 0 + _time 
| fillnull class value="NULL" 
| streamstats sum(increment) as post_concurrency by SMF30CLS
| eval concurrency = if(increment==-1, post_concurrency+1, post_concurrency)
| timechart limit=0 span=15m max(concurrency) as max_concurrency last(post_concurrency) as last_concurrency by SMF30CLS
| filldown last_concurrency* 
| foreach "max_concurrency: *" [eval &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;=coalesce('max_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;','last_concurrency: &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;')] 
| fields - last_concurrency* max_concurrency*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 10:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/533552#M150767</guid>
      <dc:creator>Hoekb03</dc:creator>
      <dc:date>2020-12-18T10:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the concurrency command to timechart the top 10 concurrencies by field sourceip?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/698332#M237145</link>
      <description>&lt;P&gt;As I had a similar problem - to count the parallel/concurrent HTTP requests grouping by time and host (which means the active threads in each server), I provide my solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=jira-prod source="/opt/jira/logs/access_log*"
| rex field=_raw "^(?&amp;lt;IP&amp;gt;\d+\.\d+\.\d+\.\d+) (?&amp;lt;REQUEST_ID&amp;gt;[0-9]+x[0-9]+x[0-9]+) (?&amp;lt;USER&amp;gt;\S+) \[.+\] \"(?&amp;lt;REQUEST&amp;gt;[A-Z]+ \S+)-? HTTP/1.1\" (?&amp;lt;STATUS&amp;gt;[0-9]+) (?&amp;lt;BYTES&amp;gt;[0-9]+) (?&amp;lt;TIME&amp;gt;[0-9]+) \"(?&amp;lt;REFERER&amp;gt;[^\"]+)\".*$"
| eval DURATION=TIME/1000
| eval START_AT=floor(_time-DURATION)
| eval END_AT=floor(_time)
| eval IN_MOMENT=mvrange(START_AT,END_AT,1)
| mvexpand IN_MOMENT
| eval _time=strptime(""+IN_MOMENT,"%s")
| chart count as COUNT, max(DURATION) as MAX_DURATION by _time, host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is parsing a real log file of Atlassian JIRA where:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;line 2 parses the JIRA access log and determines its elements, including the duration in milliseconds of the request. Note that the request is logged at the moment it is complete thus _time is the end time&lt;/LI&gt;&lt;LI&gt;lies 3-5 calculate the duration in seconds, start second and end second&lt;/LI&gt;&lt;LI&gt;line 6 fills in IN_MOMENT each of the seconds the request is active, having at least one value when the start second is equal to the end second&lt;/LI&gt;&lt;LI&gt;line 7 duplicates the even for each of the seconds listed in IN_MOMENT, setting the event's IN_MOMENT field to the current second as a regular single value&lt;/LI&gt;&lt;LI&gt;line 8 is more a hack - convert the IN_MOMENT from epoch number into a timestamp&lt;/LI&gt;&lt;LI&gt;line 9 calculate as whatever statistics/chart/timechart needed grouping by _time and host&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This worked fine for me.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 10:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-concurrency-command-to-timechart-the-top-10/m-p/698332#M237145</guid>
      <dc:creator>popovr</dc:creator>
      <dc:date>2024-09-06T10:41:33Z</dc:date>
    </item>
  </channel>
</rss>

