<?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: Delta for different fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13227#M1191</link>
    <description>&lt;P&gt;You might also find &lt;CODE&gt;eventstats&lt;/CODE&gt; useful here, if your looking for some data trending over a few events.&lt;/P&gt;</description>
    <pubDate>Wed, 12 May 2010 03:40:12 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-05-12T03:40:12Z</dc:date>
    <item>
      <title>Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13225#M1189</link>
      <description>&lt;P&gt;I need to calculate the object allocation rate in the jvm.  That value can be derived from the jvmlogs.  If I subtract the "heapBeforeGC" field in one line from the “heapAfterGC” field in the previous line and divide it by the elapse time I can get a good estimate for how many bytes we allocate in the jvm per unit of time.&lt;BR /&gt;
I need to trend that value.&lt;/P&gt;

&lt;P&gt;Delta provides a diff between the same field in adjacent events. What can I use to diff different fields in adjacent events, and then trend that?&lt;/P&gt;

&lt;P&gt;Here are couple of log lines:&lt;/P&gt;

&lt;P&gt;2010-05-11T00:09:26.079+0000: 325107.330: [GC [PSYoungGen: 451418K-&amp;gt;42291K(453312K)] &lt;STRONG&gt;1847697K&lt;/STRONG&gt;-&amp;gt;1438569K(1874624K), 0.0203820 secs] [Times: user=0.25 sys=0.01, real=0.02 secs] &lt;/P&gt;

&lt;P&gt;2010-05-11T00:09:29.776+0000: 325111.027: [GC [PSYoungGen: 453299K-&amp;gt;45942K(460864K)] 1849577K-&amp;gt;&lt;STRONG&gt;1442220K&lt;/STRONG&gt;(1882176K), 0.0228840 secs] [Times: user=0.27 sys=0.01, real=0.03 secs] &lt;/P&gt;

&lt;P&gt;I want to diff the fields in bold for successive events&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2010 07:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13225#M1189</guid>
      <dc:creator>nbharadwaj</dc:creator>
      <dc:date>2010-05-11T07:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13226#M1190</link>
      <description>&lt;P&gt;Please look at the &lt;CODE&gt;delta&lt;/CODE&gt; search command: &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Delta" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Delta&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2010 11:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13226#M1190</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-11T11:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13227#M1191</link>
      <description>&lt;P&gt;You might also find &lt;CODE&gt;eventstats&lt;/CODE&gt; useful here, if your looking for some data trending over a few events.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2010 03:40:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13227#M1191</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-12T03:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13228#M1192</link>
      <description>&lt;P&gt;Delta only works for the same field. I am trying to subtract fieldA in current event from fieldB on previous event&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2010 03:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13228#M1192</guid>
      <dc:creator>nbharadwaj</dc:creator>
      <dc:date>2010-05-12T03:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13229#M1193</link>
      <description>&lt;P&gt;You can rename or simply eval fields to a field with the same name before applying delta.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2010 04:45:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13229#M1193</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-12T04:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13230#M1194</link>
      <description>&lt;P&gt;&lt;TIME1&gt;:A=1:B=2 &lt;BR /&gt;
&lt;TIME2&gt;:A=10:B=20 &lt;BR /&gt;
My delta needs to be: B from time2 minus A from time1. If I eval both fields to the same variable, how do I differentiate? Can u give me an example please?&lt;/TIME2&gt;&lt;/TIME1&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2010 10:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13230#M1194</guid>
      <dc:creator>nbharadwaj</dc:creator>
      <dc:date>2010-05-13T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13231#M1195</link>
      <description>&lt;P&gt;UPDATE:   What you want to do, is use streamstats and eval, as in the following. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| streamstats current=f first(heapAfterGC) as previousheapAfterGC | eval difference=heapBeforeGC-previousheapAfterGC&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Neither delta nor autoregress will be of much use to you. &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Delta makes a lot of sense, except that it seems it cant handle this case where the two fields are different.  You could maybe eval the old field to the new field and somehow get a multivalued field then that has both values, but im not sure what to do then... &lt;/P&gt;

&lt;P&gt;But It looks like the &lt;CODE&gt;autoregress&lt;/CODE&gt; command might give you a different way:&lt;BR /&gt;
&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Autoregress" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Autoregress&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | autoregress heapAfterGC AS previousHeapAfterGC p=1 | eval delta=heapAfterGC-previousHeapAfterGC&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Autoregress was created primarily to give you moving averages (with p&amp;gt;1), but it seems to work fine with p=1 too.&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2010 09:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13231#M1195</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-05-14T09:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Delta for different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13232#M1196</link>
      <description>&lt;P&gt;Thanks that might help. However I am using 4.0.10, and it seems autoregress is available in 4.1 and above. Need to upgrade!&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2010 12:32:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Delta-for-different-fields/m-p/13232#M1196</guid>
      <dc:creator>nbharadwaj</dc:creator>
      <dc:date>2010-05-14T12:32:09Z</dc:date>
    </item>
  </channel>
</rss>

