<?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: Perform Eval on results on monthly TimeChart results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170823#M48917</link>
    <description>&lt;P&gt;You loose the account field after the timechart so the lookup has to go before the  timechart and the you have to somehow make sure you do  not loose the allotment information in the timechart. The allotment is allways the same so the first or last function should work:&lt;BR /&gt;
sourcetype="mongoose_data" | WHERE account="SAMPLEACCOUNT" | LOOKUP customer_list accountName AS account OUTPUT allotment AS monthAlloted | timechart span=mon first(monthAlloted) as monthAlloted sum(activities) AS consumedMtd BY account&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:03:18 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2020-09-28T16:03:18Z</dc:date>
    <item>
      <title>Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170818#M48912</link>
      <description>&lt;P&gt;I basically have a 3 step problem. #1 is figured out.&lt;/P&gt;

&lt;P&gt;1) I've created a monthly timechart adding summing up a bunch of results throughout the month with a command like:&lt;/P&gt;

&lt;P&gt;timechart span=mon sum(activities) AS totalActivities BY Group&lt;/P&gt;

&lt;P&gt;2) I have a static allotment value which I'm pulling from a lookup table that I'd like to compare to the totalActivities for each month (e.g. overage=totalActivities-allotment).&lt;/P&gt;

&lt;P&gt;3) I'd like the timechart to list that overage by month if &amp;gt;0.&lt;/P&gt;

&lt;P&gt;How can I do this?  I can't figure out how to #2, let alone #3.  Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 22:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170818#M48912</guid>
      <dc:creator>atornes</dc:creator>
      <dc:date>2014-02-28T22:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170819#M48913</link>
      <description>&lt;P&gt;I used this search to test:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | stats count by date_month,sourcetype| lookup test date_month | eval overage=count-allotment | where overage&amp;gt;0 | chart sum(count) as sum max(overage) as overage over date_month by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The test lookup has the following content&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month,allotment
january,1200
february,1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adopted to the info in your question I'd try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xy data with activities and Group | stats sum(activities) as totalActivities by date_month,Group | lookup test date_month | eval overage=totalActivities-allotment | where overage&amp;gt;0 | chart max(totalActivities) as totalActivities  max(overage) as overage over date_month 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 22:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170819#M48913</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2014-02-28T22:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170820#M48914</link>
      <description>&lt;P&gt;That helps, BUT if I want to use timechart instead of stats, and not exclude overages&amp;lt;0, how could I do so.&lt;/P&gt;

&lt;P&gt;Say if I want to do a trend line of their use and graph their allotted as a static horizontal line.&lt;/P&gt;

&lt;P&gt;sourcetype="mongoose_data" | WHERE account="SAMPLEACCOUNT"  | timechart span=mon sum(activities) AS consumedMtd BY account&lt;BR /&gt;
| LOOKUP customer_list accountName AS account OUTPUT allotment AS monthAlloted  | table _time consumedMtd monthAlloted&lt;/P&gt;

&lt;P&gt;I can't get it to append the monthAlloted, basically the lookup doesn't work.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170820#M48914</guid>
      <dc:creator>atornes</dc:creator>
      <dc:date>2020-09-28T16:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170821#M48915</link>
      <description>&lt;P&gt;That helps, BUT if I want to use timechart instead of stats, and not exclude overages&amp;lt;0, how could I do so.&lt;/P&gt;

&lt;P&gt;Say if I want to do a trend line of their use and graph their allotted as a static horizontal line.&lt;/P&gt;

&lt;P&gt;sourcetype="mongoose_data" | WHERE account="SAMPLEACCOUNT"  | timechart span=mon sum(activities) AS consumedMtd BY account&lt;BR /&gt;
| LOOKUP customer_list accountName AS account OUTPUT allotment AS monthAlloted  | table _time consumedMtd monthAlloted&lt;/P&gt;

&lt;P&gt;I can't get it to append the monthAlloted, basically the lookup doesn't work.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170821#M48915</guid>
      <dc:creator>atornes</dc:creator>
      <dc:date>2020-09-28T16:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170822#M48916</link>
      <description>&lt;P&gt;what is the content of your lookup file?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 21:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170822#M48916</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-03T21:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170823#M48917</link>
      <description>&lt;P&gt;You loose the account field after the timechart so the lookup has to go before the  timechart and the you have to somehow make sure you do  not loose the allotment information in the timechart. The allotment is allways the same so the first or last function should work:&lt;BR /&gt;
sourcetype="mongoose_data" | WHERE account="SAMPLEACCOUNT" | LOOKUP customer_list accountName AS account OUTPUT allotment AS monthAlloted | timechart span=mon first(monthAlloted) as monthAlloted sum(activities) AS consumedMtd BY account&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170823#M48917</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2020-09-28T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Perform Eval on results on monthly TimeChart results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170824#M48918</link>
      <description>&lt;P&gt;Oh, and the reason I used the stats command was to fake a timechart using the date_month field. I thoght the allotment was different per month not per user ...&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 22:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Perform-Eval-on-results-on-monthly-TimeChart-results/m-p/170824#M48918</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2014-03-05T22:44:43Z</dc:date>
    </item>
  </channel>
</rss>

