<?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 calculate concurrent transactions grouped with a particular field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58654#M14378</link>
    <description>&lt;P&gt;If you just want the concurrency number, and not a list of the actual pids active at any one time, you can do the following (don't do trasnaction first)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval counter = if(searchmatch("Started process"),1,-1) | sort 0 + _time | streamstats sum(counter) as concurrency by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At which point you will have a 'concurrency' field for each event that represents the number of active pids at the time of that event (or rather at a time right after that event since it will count the effect of that event itself)&lt;/P&gt;

&lt;P&gt;You can then doing something like &lt;CODE&gt;| timechart max(concurrency) by hostname&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2010 05:12:37 GMT</pubDate>
    <dc:creator>steveyz</dc:creator>
    <dc:date>2010-09-28T05:12:37Z</dc:date>
    <item>
      <title>How to calculate concurrent transactions grouped with a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58653#M14377</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We have a centralized log from an application which reports activities on multiple hosts in a single log file.&lt;/P&gt;

&lt;P&gt;Simplified, the log looks like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;time-stamp&amp;gt; : &amp;lt;host-name&amp;gt; : Started process pid = ...
&amp;lt;time-stamp&amp;gt; : &amp;lt;host-name&amp;gt; : Process pid = ... completed with status [...]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to list the concurrent processes on each host at any time. &lt;/P&gt;

&lt;P&gt;I have the following query to group into transactions, which gives the expected results with the duration. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction hostname pid startswith=...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I add the concurrency as "&lt;CODE&gt;| concurrency duration=duration&lt;/CODE&gt;", the concurrency field populated has the concurrent processes as a whole and not for each hostname.&lt;/P&gt;

&lt;P&gt;From the docs, I dont see any way to specify grouping field(s) for 'concurrency'. Is there any option to specify the same? Or can I get the expected report thru some other mechanism.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Krishna &lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2010 10:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58653#M14377</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2010-09-27T10:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate concurrent transactions grouped with a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58654#M14378</link>
      <description>&lt;P&gt;If you just want the concurrency number, and not a list of the actual pids active at any one time, you can do the following (don't do trasnaction first)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval counter = if(searchmatch("Started process"),1,-1) | sort 0 + _time | streamstats sum(counter) as concurrency by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At which point you will have a 'concurrency' field for each event that represents the number of active pids at the time of that event (or rather at a time right after that event since it will count the effect of that event itself)&lt;/P&gt;

&lt;P&gt;You can then doing something like &lt;CODE&gt;| timechart max(concurrency) by hostname&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2010 05:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58654#M14378</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2010-09-28T05:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate concurrent transactions grouped with a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58655#M14379</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;

&lt;P&gt;Sorry for the really late response. I found that the query you gave (using streamstats and by clause) works, but as you mentioned, it is only useful when I dont need the values.&lt;/P&gt;

&lt;P&gt;I have two use-cases, 1) populate a graph report in the dashboard 2) results of the same to be inspected.&lt;/P&gt;

&lt;P&gt;Item #2 is still open since concurrency does not have a 'by' clause. Currently, the only way is to filter by hostname ahead and pipe it to transaction (which does not serve the purpose of giving a system level view) &lt;/P&gt;

&lt;P&gt;Do you agree if this can be a feature request, or there's some other way one should treat my requirement.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Oct 2010 14:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58655#M14379</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2010-10-10T14:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate concurrent transactions grouped with a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58656#M14380</link>
      <description>&lt;P&gt;I have the exact same problem.  Being able to add the "by" clause for concurrency would be ideal....this is really messy.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2012 18:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-concurrent-transactions-grouped-with-a/m-p/58656#M14380</guid>
      <dc:creator>bischofk</dc:creator>
      <dc:date>2012-11-16T18:12:54Z</dc:date>
    </item>
  </channel>
</rss>

