<?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: Subtraction of the duration in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-the-duration/m-p/95670#M182472</link>
    <description>&lt;P&gt;Assuming you have the duration in a field called 'dur'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | eventstats avg(dur) AS avgdur | eval durdiff = dur - avgdur | table avg_dur durdiff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may also want to round off the numbers by inserting an &lt;CODE&gt;eval avgdur=round(avgdur,x)&lt;/CODE&gt; after the &lt;CODE&gt;eventstats&lt;/CODE&gt;. &lt;CODE&gt;x&lt;/CODE&gt; is the number of decimal figures you want.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2012 13:55:38 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2012-10-19T13:55:38Z</dc:date>
    <item>
      <title>Subtraction of the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-the-duration/m-p/95669#M182471</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;i hav the current duration of each and ever task as&lt;/P&gt;

&lt;P&gt;time      Taskname     duration to complete the task&lt;/P&gt;

&lt;P&gt;11.30      task1          1&lt;/P&gt;

&lt;P&gt;11.32      task2         0.56&lt;/P&gt;

&lt;P&gt;11.40      task1         1.35&lt;/P&gt;

&lt;P&gt;11.21      task3         4 &lt;/P&gt;

&lt;P&gt;now i want to calculate the average duration of the each task ,and i have to calculate the difference between current duration and the avg duration of the corresponding task&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 07:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-the-duration/m-p/95669#M182471</guid>
      <dc:creator>splunkpoornima</dc:creator>
      <dc:date>2012-10-19T07:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of the duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-the-duration/m-p/95670#M182472</link>
      <description>&lt;P&gt;Assuming you have the duration in a field called 'dur'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | eventstats avg(dur) AS avgdur | eval durdiff = dur - avgdur | table avg_dur durdiff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may also want to round off the numbers by inserting an &lt;CODE&gt;eval avgdur=round(avgdur,x)&lt;/CODE&gt; after the &lt;CODE&gt;eventstats&lt;/CODE&gt;. &lt;CODE&gt;x&lt;/CODE&gt; is the number of decimal figures you want.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 13:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-the-duration/m-p/95670#M182472</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-19T13:55:38Z</dc:date>
    </item>
  </channel>
</rss>

