<?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: Maths problem that i am hoping Splunk has a function for in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320583#M164580</link>
    <description>&lt;P&gt;It's not a simple "function", but it's also not hard to do.&lt;/P&gt;

&lt;P&gt;You are going to have to stitch together the parent and child events.  Use the methods in one of these posts to calculate which points in time overlap and which there are no children running.   &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/513002/how-to-graph-sum-of-overlapping-values-given-start.html#answer-514225"&gt;https://answers.splunk.com/answers/513002/how-to-graph-sum-of-overlapping-values-given-start.html#answer-514225&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/565112/suggestions-for-charting-backlogs-by-month.html"&gt;https://answers.splunk.com/answers/565112/suggestions-for-charting-backlogs-by-month.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 22:34:31 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-12-06T22:34:31Z</dc:date>
    <item>
      <title>Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320578#M164575</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I have a Maths problem that i am hoping Splunk has a function for.&lt;BR /&gt;
It is in relation to calculation the % of time code is running out of a Total.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;So Example one - The easy example&lt;/STRONG&gt;&lt;BR /&gt;
The Parent method takes 10 seconds [From 0 -10]&lt;BR /&gt;
A Clild method takes 5 seconds. From 2-7&lt;BR /&gt;
The child method is 50% of the Calculation&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example 2 - a bit more difficult&lt;/STRONG&gt;&lt;BR /&gt;
The Parent method takes 10 seconds [From 0 -10]&lt;BR /&gt;
A child method is called twice from 0-2 and 4-6 so in total 4 seconds =&amp;gt; 40%&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example 3 _ In Parallel&lt;/STRONG&gt;&lt;BR /&gt;
The Parent method takes 10 seconds [From 0 -10]&lt;BR /&gt;
A child method is called 4 time in parallel overlapping can happen&lt;BR /&gt;
0-5&lt;BR /&gt;
2-5&lt;BR /&gt;
6-7&lt;BR /&gt;
6-9&lt;/P&gt;

&lt;P&gt;So if i sum the time i get 0-5 =5, 2-5 =3, 6-7=1 6-9 =2 Total = 11 = &amp;gt; 110% [This is the issues, the real answer is 80%. As there is nothing running between 5-6 and 9-10]. &lt;/P&gt;

&lt;P&gt;So i have 2 vectors with start and stop of all these child method, and i would love if Splunk has a math function that would give me Total time the children was running i.e 8 and i will supplay 10 so i can get 80%&lt;/P&gt;

&lt;P&gt;All help on this is welcomed.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Robert Lynch&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 14:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320578#M164575</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-12-05T14:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320579#M164576</link>
      <description>&lt;P&gt;Were you able to achieve the result using SPL?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320579#M164576</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-05T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320580#M164577</link>
      <description>&lt;P&gt;@robertlynch2020, what does your current events, fields and query look like?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320580#M164577</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-06T01:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320581#M164578</link>
      <description>&lt;P&gt;| tstats summariesonly=true avg(All_TPS_Logs.duration) AS average&lt;BR /&gt;
FROM datamodel=MLC_TPS_DEBUG4 &lt;BR /&gt;
WHERE (nodename=All_TPS_Logs &lt;BR /&gt;
host=TALANX_PROD_1-rlynch-prod_splunk_20171204 ) &lt;BR /&gt;
NOT All_TPS_Logs.overflow=true &lt;BR /&gt;
GROUPBY All_TPS_Logs.fullyQualifiedMethod All_TPS_Logs.startTime All_TPS_Logs.endTime | fields - average&lt;/P&gt;

&lt;P&gt;OUTPUT&lt;/P&gt;

&lt;P&gt;murex.apps.business.server.compliance.am.home.DefaultAssetMgmtComplianceAdministrationServiceSession#actuallyCheck  1512382324411   1512382324553&lt;BR /&gt;
murex.apps.business.server.compliance.am.home.DefaultAssetMgmtComplianceAdministrationServiceSession#associate  1512382323324   1512382323324&lt;BR /&gt;
murex.apps.business.server.compliance.am.home.DefaultAssetMgmtComplianceAdministrationServiceSession#buildSourceEventsOffRisksAndPropagateToDepedents   1512382323733   1512382324411&lt;BR /&gt;
murex.apps.business.server.compliance.am.home.DefaultAssetMgmtComplianceAdministrationServiceSession#collectSourceEvents    1512382324411   1512382324485&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:09:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320581#M164578</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2020-09-29T17:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320582#M164579</link>
      <description>&lt;P&gt;So i get 3 fields &lt;/P&gt;

&lt;P&gt;1) method.class&lt;BR /&gt;
2) start (epoc to the millisecond)&lt;BR /&gt;
3) stop (epoc to the millisecond)&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320582#M164579</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-12-06T16:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320583#M164580</link>
      <description>&lt;P&gt;It's not a simple "function", but it's also not hard to do.&lt;/P&gt;

&lt;P&gt;You are going to have to stitch together the parent and child events.  Use the methods in one of these posts to calculate which points in time overlap and which there are no children running.   &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/513002/how-to-graph-sum-of-overlapping-values-given-start.html#answer-514225"&gt;https://answers.splunk.com/answers/513002/how-to-graph-sum-of-overlapping-values-given-start.html#answer-514225&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/565112/suggestions-for-charting-backlogs-by-month.html"&gt;https://answers.splunk.com/answers/565112/suggestions-for-charting-backlogs-by-month.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 22:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320583#M164580</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-06T22:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Maths problem that i am hoping Splunk has a function for</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320584#M164581</link>
      <description>&lt;P&gt;Thanks for this, it took a bit of time but i got this in the end.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true values(All_TPS_Logs.duration) AS average, count(All_TPS_Logs.duration) AS count2
    FROM datamodel=MLC_TPS_DEBUG4 
    WHERE (nodename=All_TPS_Logs host=TALANX-SLOW_LIMITPREVIEW_INT-2017-12-14_19_20_26-archive )  
    GROUPBY All_TPS_Logs.fullyQualifiedMethod All_TPS_Logs.startTime All_TPS_Logs.endTime All_TPS_Logs.duration
| sort All_TPS_Logs.fullyQualifiedMethod -1 All_TPS_Logs.startTime - All_TPS_Logs.duration 
| streamstats max(All_TPS_Logs.fullyQualifiedMethod) as fullyQualifiedMethod_previous current=false 
| streamstats max(All_TPS_Logs.endTime) as endTime_previous current=false reset_before="($All_TPS_Logs.fullyQualifiedMethod$!=$fullyQualifiedMethod_previous$)" 
| streamstats sum(All_TPS_Logs.duration) as Duration_p reset_before="($All_TPS_Logs.fullyQualifiedMethod$!=$fullyQualifiedMethod_previous$)" 
| eval s_duration_add = if($endTime_previous$!="*",if($endTime_previous$&amp;gt;$All_TPS_Logs.endTime$ , 0 ,if($All_TPS_Logs.startTime$ &amp;gt; $endTime_previous$,$All_TPS_Logs.duration$,$All_TPS_Logs.endTime$ - $endTime_previous$)),$All_TPS_Logs.duration$) 
| streamstats sum(s_duration_add) as Duration_s reset_before="($All_TPS_Logs.fullyQualifiedMethod$!=$fullyQualifiedMethod_previous$)" 
| table All_TPS_Logs.fullyQualifiedMethod All_TPS_Logs.startTime All_TPS_Logs.endTime endTime_previous fullyQualifiedMethod_previous All_TPS_Logs.duration s_duration_add Duration_p Duration_s | stats max(Duration_s) as Duration_s  max(Duration_p) as Duration_p avg(All_TPS_Logs.duration) as average count(All_TPS_Logs.duration) AS count, stdev(All_TPS_Logs.duration) AS stdev, median(All_TPS_Logs.duration) AS median, exactperc95(All_TPS_Logs.duration) AS perc95, exactperc99.5(All_TPS_Logs.duration) AS perc99.5, min(All_TPS_Logs.duration) AS min, max(All_TPS_Logs.duration) AS max by All_TPS_Logs.fullyQualifiedMethod  | eval Time_Sequential=Duration_s/((1513274889.932 - 1513274878.77)*10) | eval Parall_vs_Sequential=Duration_p/Duration_s  | sort - Duration_s | Table All_TPS_Logs.fullyQualifiedMethod Time_Sequential Duration_s Parall_vs_Sequential Duration_p average count stdev median perc95 perc99.5 min max
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2017 09:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Maths-problem-that-i-am-hoping-Splunk-has-a-function-for/m-p/320584#M164581</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-12-18T09:41:53Z</dc:date>
    </item>
  </channel>
</rss>

