<?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 Stats 2 results together and filling in the blank fields with dynamically-generated values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499097#M139016</link>
    <description>&lt;P&gt;I need to create volume-base alerts so we know when volume drops.  The services we need to monitor are usually suffixed with its version (e.g. placeOrder is actually placeOrder_v1, placeOrder_v2, etc) which often ramp up and down while servicing their respective percentage of the total traffic, causing our volume based alerts to fire even though the total calls for the overall feature are the same.  I chopped off the suffix and created a calculated "group" field and want to use that, but this leaves a problem when the service isn't firing at all.  the volume becomes 0, but so does the "group", or total, volume, for that row.&lt;/P&gt;

&lt;P&gt;here is the half way point of my larger query so you can see the structure that is built as i append 2 results: the current, and the 6 week average, in run-anywhere query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval groupVolume="375" | eval volume="175"
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval groupVolume="375" | eval volume="200"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval pastGroupVolume="325" | eval pastVolume="200"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v2" | eval pastGroupVolume="325" | eval pastVolume="100"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval pastGroupVolume="325" | eval pastVolume="25"]
| fields _time, group, service, groupVolume, volume, pastVolume, pastGroupVolume
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this gives the following table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group          service         GroupVolume   Volume     PastGroupVolume   PastVolume
placeOrder     placeOrder_v1   375           175
placeOrder     placeOrder_v3   375           200
placeOrder     placeOrder_v1                            325               200
placeOrder     placeOrder_v2                            325               100
placeOrder     placeOrder_v3                            325               25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I zip them with this command added added to it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(groupVolume) as groupVolume, values(volume) as volume, values(pastGroupVolume) as pastGroupVolume, values(pastVolume) as pastVolume by group, service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group                  service    GroupVolume    Volume   PastGroupVolume   PastVolume
placeOrder        placeOrder_v1   375            175      325              200
placeOrder        placeOrder_v2                           325              100
placeOrder        placeOrder_v3   375            200      325              25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_v2 is no longer being called, while _v1 is ramping down, and _v3 is ramping up.&lt;/P&gt;

&lt;P&gt;An alert will fire for _v2 because the current group volume is 0 as i compare it to the historical avg.  it needs to acquire 375 because it's the same group.  How can i carry over this value into the row for _v2?&lt;/P&gt;

&lt;P&gt;I need it to show this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group                  service    GroupVolume    Volume   PastGroupVolume   PastVolume
placeOrder        placeOrder_v1   375            175      325              200
placeOrder        placeOrder_v2   375                     325              100
placeOrder        placeOrder_v3   375            200      325              25
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:30:02 GMT</pubDate>
    <dc:creator>weidertc</dc:creator>
    <dc:date>2020-09-30T02:30:02Z</dc:date>
    <item>
      <title>Stats 2 results together and filling in the blank fields with dynamically-generated values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499097#M139016</link>
      <description>&lt;P&gt;I need to create volume-base alerts so we know when volume drops.  The services we need to monitor are usually suffixed with its version (e.g. placeOrder is actually placeOrder_v1, placeOrder_v2, etc) which often ramp up and down while servicing their respective percentage of the total traffic, causing our volume based alerts to fire even though the total calls for the overall feature are the same.  I chopped off the suffix and created a calculated "group" field and want to use that, but this leaves a problem when the service isn't firing at all.  the volume becomes 0, but so does the "group", or total, volume, for that row.&lt;/P&gt;

&lt;P&gt;here is the half way point of my larger query so you can see the structure that is built as i append 2 results: the current, and the 6 week average, in run-anywhere query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval groupVolume="375" | eval volume="175"
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval groupVolume="375" | eval volume="200"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval pastGroupVolume="325" | eval pastVolume="200"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v2" | eval pastGroupVolume="325" | eval pastVolume="100"]
| append
[| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval pastGroupVolume="325" | eval pastVolume="25"]
| fields _time, group, service, groupVolume, volume, pastVolume, pastGroupVolume
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this gives the following table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group          service         GroupVolume   Volume     PastGroupVolume   PastVolume
placeOrder     placeOrder_v1   375           175
placeOrder     placeOrder_v3   375           200
placeOrder     placeOrder_v1                            325               200
placeOrder     placeOrder_v2                            325               100
placeOrder     placeOrder_v3                            325               25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I zip them with this command added added to it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(groupVolume) as groupVolume, values(volume) as volume, values(pastGroupVolume) as pastGroupVolume, values(pastVolume) as pastVolume by group, service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group                  service    GroupVolume    Volume   PastGroupVolume   PastVolume
placeOrder        placeOrder_v1   375            175      325              200
placeOrder        placeOrder_v2                           325              100
placeOrder        placeOrder_v3   375            200      325              25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_v2 is no longer being called, while _v1 is ramping down, and _v3 is ramping up.&lt;/P&gt;

&lt;P&gt;An alert will fire for _v2 because the current group volume is 0 as i compare it to the historical avg.  it needs to acquire 375 because it's the same group.  How can i carry over this value into the row for _v2?&lt;/P&gt;

&lt;P&gt;I need it to show this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;group                  service    GroupVolume    Volume   PastGroupVolume   PastVolume
placeOrder        placeOrder_v1   375            175      325              200
placeOrder        placeOrder_v2   375                     325              100
placeOrder        placeOrder_v3   375            200      325              25
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499097#M139016</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2020-09-30T02:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Stats 2 results together and filling in the blank fields with dynamically-generated values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499098#M139017</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that generates data
 | stats values(groupVolume) as groupVolume, values(volume) as volume, values(pastGroupVolume) as pastGroupVolume, values(pastVolume) as pastVolume by group, service
| eventstats values(groupVolume) as groupVolume by group
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499098#M139017</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-10-08T14:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Stats 2 results together and filling in the blank fields with dynamically-generated values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499099#M139018</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;First thanks for the splunk query, it's way simpler to help you like that.&lt;BR /&gt;
Can you try &lt;CODE&gt;eventstats&lt;/CODE&gt; like that &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval groupVolume="375" | eval volume="175"
 | append
 [| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval groupVolume="375" | eval volume="200"]
 | append
 [| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v1" | eval pastGroupVolume="325" | eval pastVolume="200"]
 | append
 [| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v2" | eval pastGroupVolume="325" | eval pastVolume="100"]
 | append
 [| makeresults 1 | eval group="placeOrder" | eval service="placeOrder_v3" | eval pastGroupVolume="325" | eval pastVolume="25"]
 | fields _time, group, service, groupVolume, volume, pastVolume, pastGroupVolume
 | stats values(groupVolume) as groupVolume, values(volume) as volume, values(pastGroupVolume) as pastGroupVolume, values(pastVolume) as pastVolume by group, service
| eventstats values(groupVolume) as groupVolume by group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will give you the values by group fore the groupVolume and it seems to solve your problem, or maybe I didn't get what was the problem ^^'&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499099#M139018</guid>
      <dc:creator>KailA</dc:creator>
      <dc:date>2019-10-08T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Stats 2 results together and filling in the blank fields with dynamically-generated values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499100#M139019</link>
      <description>&lt;P&gt;This does the trick.  Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499100#M139019</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-10-08T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Stats 2 results together and filling in the blank fields with dynamically-generated values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499101#M139020</link>
      <description>&lt;P&gt;I was looking at something like this but couldn't figure out how to use eventstats properly.  thanks!  this works.  I kept putting it before instead of after all this.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-2-results-together-and-filling-in-the-blank-fields-with/m-p/499101#M139020</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2019-10-08T14:51:39Z</dc:date>
    </item>
  </channel>
</rss>

