<?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: Performing calculations on multi values to show on timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329383#M98035</link>
    <description>&lt;P&gt;As long as &lt;CODE&gt;_time&lt;/CODE&gt; is correct (matches what is in the event), order doesn't matter; just do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here | timechart avg(count_rec) BY queue_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or perhaps you need &lt;CODE&gt;sum&lt;/CODE&gt; or &lt;CODE&gt;max&lt;/CODE&gt; instead of &lt;CODE&gt;avg&lt;/CODE&gt; and you might need a &lt;CODE&gt;span=&lt;/CODE&gt; if you don't like what is automatically selected for you.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 15:33:46 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-07-25T15:33:46Z</dc:date>
    <item>
      <title>Performing calculations on multi values to show on timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329382#M98034</link>
      <description>&lt;P&gt;Hi All, need some insight and help.&lt;/P&gt;

&lt;P&gt;I have a MQ like objects, information regarding which is forwarded into splunk at every 5mins.&lt;/P&gt;

&lt;P&gt;Now events looks something like this:&lt;/P&gt;

&lt;P&gt;2017-05-10 09:00.000||queue_name=MQ1||count_rec=100&lt;BR /&gt;
2017-05-10 09:05.000||queue_name=MQ1||count_rec=110&lt;BR /&gt;
2017-05-10 09:10.000||queue_name=MQ1||count_rec=110&lt;BR /&gt;
2017-05-10 09:15.000||queue_name=MQ1||count_rec=130&lt;BR /&gt;
2017-05-10 09:00.000||queue_name=MQ2||count_rec=30&lt;BR /&gt;
2017-05-10 09:05.000||queue_name=MQ2||count_rec=60&lt;BR /&gt;
2017-05-10 09:10.000||queue_name=MQ2||count_rec=100&lt;BR /&gt;
2017-05-10 09:15.000||queue_name=MQ2||count_rec=100&lt;/P&gt;

&lt;P&gt;Events are in revese chron. Order and even the fields are getting extracted. Rec_count is the number of data published to the MQ, this is the only info i could get.&lt;BR /&gt;
So difference between value in current with prev. Events would give the count of data came in in last 5mins.&lt;/P&gt;

&lt;P&gt;Now i am trying to show on timechart the number of records coming to the MQ over a span.&lt;/P&gt;

&lt;P&gt;Is it possible, what should be the approach for this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:03:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329382#M98034</guid>
      <dc:creator>nishantmishra21</dc:creator>
      <dc:date>2020-09-29T15:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations on multi values to show on timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329383#M98035</link>
      <description>&lt;P&gt;As long as &lt;CODE&gt;_time&lt;/CODE&gt; is correct (matches what is in the event), order doesn't matter; just do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here | timechart avg(count_rec) BY queue_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or perhaps you need &lt;CODE&gt;sum&lt;/CODE&gt; or &lt;CODE&gt;max&lt;/CODE&gt; instead of &lt;CODE&gt;avg&lt;/CODE&gt; and you might need a &lt;CODE&gt;span=&lt;/CODE&gt; if you don't like what is automatically selected for you.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:33:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329383#M98035</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-25T15:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations on multi values to show on timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329384#M98036</link>
      <description>&lt;P&gt;Could try, buy each event is the record count, i would need difference between the event and prior record count, in order to get exact number of records for the particular event.  Post which i might use first() and then plotbon timechart.&lt;/P&gt;

&lt;P&gt;How to get the difference?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329384#M98036</guid>
      <dc:creator>nishantmishra21</dc:creator>
      <dc:date>2017-07-25T15:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations on multi values to show on timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329385#M98037</link>
      <description>&lt;P&gt;Try this ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that gets _time, queue_name and count_rec
| bin _time span=5m
| stats max(count_rec) as count_rec by queue_name _time 
| streamstats current=f last(count_rec) as prev_count by queue_name
| eval new_recs = count_rec - prev_count
| timechart span=5m sum(new_recs) by queue_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the records all have &lt;CODE&gt;_times&lt;/CODE&gt; that are exactly on the 5 min mark, then the &lt;CODE&gt;bin&lt;/CODE&gt; is probably not needed.  &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 21:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329385#M98037</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-25T21:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations on multi values to show on timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329386#M98038</link>
      <description>&lt;P&gt;OK, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that gets _time, queue_name and count_rec
| timechart range(count_rec) AS increase_in_this_span BY queue_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2017 22:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Performing-calculations-on-multi-values-to-show-on-timechart/m-p/329386#M98038</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-25T22:19:46Z</dc:date>
    </item>
  </channel>
</rss>

