<?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: Count the concurrent transactions with a single log entry by transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102884#M26577</link>
    <description>&lt;P&gt;Well, I already tried this but it didn't work&lt;/P&gt;</description>
    <pubDate>Thu, 31 Jan 2013 13:54:03 GMT</pubDate>
    <dc:creator>ypiolet</dc:creator>
    <dc:date>2013-01-31T13:54:03Z</dc:date>
    <item>
      <title>Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102879#M26572</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Hey there,&lt;/P&gt;

&lt;P&gt;I'm a beginner with Splunk and have questions about &lt;CODE&gt;timechart&lt;/CODE&gt; and &lt;CODE&gt;_time&lt;/CODE&gt; variable. Here is my situation:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-01-29T09:12:27.010175+00:00 172.21.1.1 local5.notice&amp;lt;173&amp;gt; 16099: GW: Jan 29 09:12:26.963: %X25-5-CALL_RECORD: Start=09:12:25.887 UTC Tue Jan 29 2013, End=09:12:26.963 UTC Tue Jan 29 2013, Rotary-number=1, Clear-cause=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've got a log file with an indexed &lt;CODE&gt;_time&lt;/CODE&gt; value which I don't care.&lt;BR /&gt;
I need to count the number of concurrent sessions per second, with the following constraints :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;There is a &lt;STRONG&gt;single entry in my log per session&lt;/STRONG&gt;, containing &lt;CODE&gt;Start&lt;/CODE&gt; time and &lt;CODE&gt;End&lt;/CODE&gt; time fields. Consequently, &lt;CODE&gt;transaction&lt;/CODE&gt; keyword seems to be useless.&lt;/LI&gt;
&lt;LI&gt;The timechart must be drawed &lt;STRONG&gt;per rotary number&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;I must not use log entry index time which is NOT correct, and &lt;STRONG&gt;use Start/End fields&lt;/STRONG&gt; instead.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;My tests&lt;/STRONG&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;For testing purposes I managed to convert times to epoch format, and compute the duration:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... 
| eval tstamp="%T.%3Q %Z %a %b %d %Y"
| eval etime=strptime(End,tstamp)
| eval stime=strptime(Start,tstamp)
| eval duration=etime-stime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;Concurrency&lt;/CODE&gt; with my &lt;CODE&gt;duration&lt;/CODE&gt; appears not to be working because it still uses log time.&lt;/P&gt;

&lt;P&gt;I tried to use the keyword &lt;CODE&gt;transaction&lt;/CODE&gt; with &lt;CODE&gt;startswith=stime&lt;/CODE&gt; &lt;CODE&gt;endswith=etime&lt;/CODE&gt; without results, and with TransacID as Session identifier but I think it is useless&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...&lt;BR /&gt;
| rex field=_raw ".&amp;gt;\s+(?&amp;lt;TransacID&amp;gt;\d+):."&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Finaly my complete search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="log" %X25-5-CALL_RECORD 
| rex field=_raw ".&amp;gt;\s+(?&amp;lt;Transacid&amp;gt;\d+):."
| eval tstamp="%T.%3Q %Z %a %b %d %Y"
| eval etime=strptime(End,tstamp)
| eval stime=strptime(Start,tstamp)
| eval _time=stime
| timechart span=1s count(eval(stime&amp;lt;=(_time) AND (_time)&amp;lt;=etime)) as InTimeRange by Rotary_number
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The diffulty is that I need to get rid of the indexed log time to use &lt;CODE&gt;concurrency&lt;/CODE&gt; or &lt;CODE&gt;timechart&lt;/CODE&gt;. that's why I used&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval _time=stime&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;I actually want to use timechart's abscissa and compare it each second...&lt;/P&gt;

&lt;P&gt;I first though it was working but values are not correct, there should be much more concurrent sessions. This may be a dimension confusion between "tables" of data, and variable names that identify a single value in a single line.&lt;/P&gt;

&lt;P&gt;Can someone help me with this case?&lt;/P&gt;

&lt;P&gt;Thanks by advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 09:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102879#M26572</guid>
      <dc:creator>ypiolet</dc:creator>
      <dc:date>2013-01-29T09:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102880#M26573</link>
      <description>&lt;P&gt;take a look at this answer &lt;A href="http://splunk-base.splunk.com/answers/69213/calculate-concurrency-of-transactions"&gt;http://splunk-base.splunk.com/answers/69213/calculate-concurrency-of-transactions&lt;/A&gt;&lt;BR /&gt;
it contains the last part you need.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102880#M26573</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-01-29T15:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102881#M26574</link>
      <description>&lt;P&gt;Ok great!&lt;BR /&gt;
Thanks to the mvexpand instruction + transaction + concurrency, I managed to come to the same situation as your initial post when you had holes in you chart. I'll try hard to understand the whole solution you gave, and adapt it to my graph. I'll let you know when it's done.&lt;/P&gt;

&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 11:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102881#M26574</guid>
      <dc:creator>ypiolet</dc:creator>
      <dc:date>2013-01-30T11:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102882#M26575</link>
      <description>&lt;P&gt;Well, I still need some more help. Here is the last part of my request:&lt;BR /&gt;
...&lt;BR /&gt;
| eval timeconcat="myStart=".stime." myEnd=".etime"&lt;BR /&gt;
| eval timemv=split(timeconcat," ") &lt;BR /&gt;
| mvexpand timemv&lt;BR /&gt;
| rex field=timemv "(?&amp;lt;_time&amp;gt;\d+.\d+)"&lt;BR /&gt;
| transaction TransacID&lt;BR /&gt;
| concurrency duration=duration&lt;BR /&gt;
| timechart span=1s max(concurrency) by Rotary_number&lt;/P&gt;

&lt;P&gt;I get the good values (that's a very good point, thank you yannK) but there are plenty of gaps. I need to fill them, but don't understand how to do it.&lt;/P&gt;

&lt;P&gt;I tried:&lt;BR /&gt;
| bucket _time span=1s&lt;BR /&gt;
| makecontinuous&lt;/P&gt;

&lt;P&gt;This didn't work. Can someone help me? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102882#M26575</guid>
      <dc:creator>ypiolet</dc:creator>
      <dc:date>2020-09-28T13:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102883#M26576</link>
      <description>&lt;P&gt;maybe an error in my search, the makecontinuous needs a field, so it should be the time.&lt;/P&gt;

&lt;P&gt;by example&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makecontinuous _time span=10m&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 15:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102883#M26576</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-01-30T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count the concurrent transactions with a single log entry by transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102884#M26577</link>
      <description>&lt;P&gt;Well, I already tried this but it didn't work&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2013 13:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-the-concurrent-transactions-with-a-single-log-entry-by/m-p/102884#M26577</guid>
      <dc:creator>ypiolet</dc:creator>
      <dc:date>2013-01-31T13:54:03Z</dc:date>
    </item>
  </channel>
</rss>

