<?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 counts by keyname in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125292#M33851</link>
    <description>&lt;P&gt;Maybe not perfect, but can perhaps serve as some inspiration&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_base_search 
| sort QueueName, _time 
| streamstats window=1 current=f first(DequeueCount) AS prevDQ by QueueName 
| table _time QueueName DequeueCount prevDQ  
| eval delta = DequeueCount - prevDQ 
| fields - prevDQ
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2014 23:47:43 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2014-01-24T23:47:43Z</dc:date>
    <item>
      <title>delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125290#M33849</link>
      <description>&lt;P&gt;How can I get a delta count by a key name when there are multiple keys for plotting the delta in a report?&lt;/P&gt;

&lt;P&gt;I have a collection that outputs like this via syslog:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TimeStampMsec="1390586680463" QueueName="ad.input" ConsumerCount="1" MessagePendingCount="0" EnqueueCount="9" DequeueCount="9"
TimeStampMsec="1390586680463" QueueName="ldap.input" ConsumerCount="0" MessagePendingCount="0" EnqueueCount="0" DequeueCount="0"
TimeStampMsec="1390586680463" QueueName="foo.bar" ConsumerCount="0" MessagePendingCount="4" EnqueueCount="0" DequeueCount="0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;EM&gt;DequeueCount&lt;/EM&gt; could increment for the next log entry for any of these records as identified by the &lt;EM&gt;QueueName&lt;/EM&gt; key.  I would like to setup a report that provides a linear graph by time for by &lt;EM&gt;QueueName&lt;/EM&gt; of the &lt;STRONG&gt;delta&lt;/STRONG&gt; on &lt;EM&gt;DequeueCount&lt;/EM&gt;.  I cannot figure this out with &lt;STRONG&gt;delta&lt;/STRONG&gt; since I can't seem to get it to take the &lt;STRONG&gt;delta&lt;/STRONG&gt; by the &lt;EM&gt;QueueName&lt;/EM&gt;, it can only take the &lt;STRONG&gt;delta&lt;/STRONG&gt; of the record previously.&lt;/P&gt;

&lt;P&gt;I have done this with &lt;STRONG&gt;mvlist&lt;/STRONG&gt;, but we could add/subtract the QueueNames and &lt;STRONG&gt;mvlist&lt;/STRONG&gt; feels like it's accessing points via an array and I can't guarantee the order.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2014 18:14:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125290#M33849</guid>
      <dc:creator>malex</dc:creator>
      <dc:date>2014-01-24T18:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125291#M33850</link>
      <description>&lt;P&gt;To compute a grouped-by delta you can use &lt;CODE&gt;streamstats&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | streamstats window=1 current=f global=f last(value) as last by key | eval delta = value-last | charting stuff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(precise syntax may vary)&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2014 23:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125291#M33850</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-24T23:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125292#M33851</link>
      <description>&lt;P&gt;Maybe not perfect, but can perhaps serve as some inspiration&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_base_search 
| sort QueueName, _time 
| streamstats window=1 current=f first(DequeueCount) AS prevDQ by QueueName 
| table _time QueueName DequeueCount prevDQ  
| eval delta = DequeueCount - prevDQ 
| fields - prevDQ
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2014 23:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125292#M33851</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-01-24T23:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125293#M33852</link>
      <description>&lt;P&gt;dammit, spent too long editing  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2014 23:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125293#M33852</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-01-24T23:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125294#M33853</link>
      <description>&lt;P&gt;but you'll need to sort before the &lt;CODE&gt;streamstats&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2014 23:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125294#M33853</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-01-24T23:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125295#M33854</link>
      <description>&lt;P&gt;Sure, but I assume that's done by the base search &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt; else the delta without grouping wouldn't have worked properly either.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2014 00:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125295#M33854</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-25T00:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125296#M33855</link>
      <description>&lt;P&gt;This is EXTREMELY EXPERIMENTAL - so your feedback is appreciated. It has been submitted to SplunkBase - hasn't been approved yet - feel free to try it out. But Seriously - I only tested this on a 6.0 Linux install. Use At YOUR OWN RISK &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; (But send me feedback if it craps.)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="http://data.kyleasmith.info/TA-deltaby.spl" target="test_blank"&gt;http://data.kyleasmith.info/TA-deltaby.spl&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The command for your data would look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_base_search | deltaby by=QueueName value=DequeueCount output=DeQueueCountDelta | timechart span=10m sum(DeQueueCountDelta) by QueueName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output is optional but useful. I think you can even stack the commands (I haven't tested that yet fully)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_base_search | deltaby by=QueueName value=DequeueCount output=DequeueDelta | deltaby=QueueName value=EnqueueCount output=EnqueueDelta | timechart span=10m sum(DequeueDelta) sum(EnqueueDelta) by QueueName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Again: Experimental (v0.1). Prone to failure (depending on your inputs). Send me feedback: &lt;A href="mailto:splunkapps@kyleasmith.info"&gt;splunkapps@kyleasmith.info&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2014 00:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125296#M33855</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-01-25T00:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: delta counts by keyname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125297#M33856</link>
      <description>&lt;P&gt;This is getting there, thanks a lot.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2014 01:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/delta-counts-by-keyname/m-p/125297#M33856</guid>
      <dc:creator>malex</dc:creator>
      <dc:date>2014-01-25T01:43:02Z</dc:date>
    </item>
  </channel>
</rss>

