<?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: Percent by multiple (say 2) fields as in msg and version in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356805#M5746</link>
    <description>&lt;P&gt;I found that in my initial test versions entered, the previous only had a very small number of events, why it didn't show up at all I'm not sure).&lt;/P&gt;

&lt;P&gt;So once I entered a fully released previous version, I got two columns. But the data was still not what I expected/wanted for my query.&lt;/P&gt;

&lt;P&gt;The Percentage change in the previous solution seems to be using a grand total(?) (somebody else commented that the solution might not be right/as expected?).&lt;/P&gt;

&lt;P&gt;For example, if I have something like&lt;/P&gt;

&lt;P&gt;msg   2.0.0  2.0.1 &lt;BR /&gt;
msg1 10      20&lt;BR /&gt;
msg2 10      20&lt;BR /&gt;
msg3 80      60&lt;/P&gt;

&lt;P&gt;then I want the values (for illustration purposes)&lt;/P&gt;

&lt;P&gt;msg   2.0.0  Total2.0.0. Percent2.0.0 2.0.1  Total2.0.1 Percent2.0.1 PercentChange&lt;BR /&gt;
msg1 10      100              .10                    40    200            .20                  .10&lt;BR /&gt;
msg2 10      100              .10                    40    200            .20                  .10&lt;BR /&gt;
msg3 80      100              .80                  120    200            .60                  -.20&lt;/P&gt;

&lt;P&gt;For actual results/visualization I'm mainly interested in PercentChange by msg or by graphing the Percent values by msg&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 02:14:01 GMT</pubDate>
    <dc:creator>pyamamoto</dc:creator>
    <dc:date>2017-08-10T02:14:01Z</dc:date>
    <item>
      <title>Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356803#M5744</link>
      <description>&lt;P&gt;I tried to use the solution in &lt;A href="https://answers.splunk.com/answers/506192/how-to-calculate-percent-increase-of-crime-by-mont.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev"&gt;https://answers.splunk.com/answers/506192/how-to-calculate-percent-increase-of-crime-by-mont.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev&lt;/A&gt; but that did not seem to give the expected results (even after correcting for the typo).&lt;/P&gt;

&lt;P&gt;The context is trying to compare the message error rate between two application versions.&lt;BR /&gt;
For example a log message might be something like&lt;BR /&gt;
ERROR: msg="The top error is still firing" appVersion=2.0.0&lt;BR /&gt;
ERROR: msg="The top error is still firing" appVersion=2.0.1&lt;BR /&gt;
in the two (or more) appVersions I am interested in (2 is enough, eg previous and just released).&lt;/P&gt;

&lt;P&gt;When I used the solution from above, I only got numbers for one appVersion (the newest) in the statistic even though the events included msgs from both.&lt;/P&gt;

&lt;P&gt;Note that I want percents by appVersion, being compared.&lt;/P&gt;

&lt;P&gt;also it does not have to be differences, but simply top msg rates per appVersion would be enough.&lt;/P&gt;

&lt;P&gt;The goal is to see if the rate of any (in particular the highest firing but any, so by largest diff may also be of interest) msg has changed in the new release.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 01:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356803#M5744</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-10T01:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356804#M5745</link>
      <description>&lt;P&gt;My version of the "calculate percent increase of crime by month over 6 years" solution was:&lt;/P&gt;

&lt;P&gt;| stats count by msg appVersion&lt;BR /&gt;
 | appendpipe [| stats first(count) as from last(count) as to by msg | eval count=round((to-from)*100/from,2) | eval appVersion="PercentChange"| table msg appVersion count] &lt;BR /&gt;
 | appendpipe [| stats sum(count) as count by msg | eval appVersion="Total"| table msg appVersion count] &lt;BR /&gt;
 | xyseries msg appVersion count&lt;/P&gt;

&lt;P&gt;This resulted in showing only the second appVersion value, and all PercentChange was 0.00.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 01:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356804#M5745</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-10T01:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356805#M5746</link>
      <description>&lt;P&gt;I found that in my initial test versions entered, the previous only had a very small number of events, why it didn't show up at all I'm not sure).&lt;/P&gt;

&lt;P&gt;So once I entered a fully released previous version, I got two columns. But the data was still not what I expected/wanted for my query.&lt;/P&gt;

&lt;P&gt;The Percentage change in the previous solution seems to be using a grand total(?) (somebody else commented that the solution might not be right/as expected?).&lt;/P&gt;

&lt;P&gt;For example, if I have something like&lt;/P&gt;

&lt;P&gt;msg   2.0.0  2.0.1 &lt;BR /&gt;
msg1 10      20&lt;BR /&gt;
msg2 10      20&lt;BR /&gt;
msg3 80      60&lt;/P&gt;

&lt;P&gt;then I want the values (for illustration purposes)&lt;/P&gt;

&lt;P&gt;msg   2.0.0  Total2.0.0. Percent2.0.0 2.0.1  Total2.0.1 Percent2.0.1 PercentChange&lt;BR /&gt;
msg1 10      100              .10                    40    200            .20                  .10&lt;BR /&gt;
msg2 10      100              .10                    40    200            .20                  .10&lt;BR /&gt;
msg3 80      100              .80                  120    200            .60                  -.20&lt;/P&gt;

&lt;P&gt;For actual results/visualization I'm mainly interested in PercentChange by msg or by graphing the Percent values by msg&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 02:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356805#M5746</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-10T02:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356806#M5747</link>
      <description>&lt;P&gt;hope i understood your question correctly,&lt;BR /&gt;
maybe try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... your search for events
| bin span=5m _time 
| stats count(eval(appVersion=="2.0.0")) as "2.0.0" count(eval(appVersion=="2.0.1")) as "2.0.1"  ... count(eval(appVersion=="n.0.0")) as "n.0.0" count as total_count by _time
| eval 2.0.0_pct = round(2.0.0/total_count*100, 2) 
| eval 2.0.1_pct = round(2.0.1/total_count*100, 2)  
....
| eval n.0.0_pct = round(n.0.0/total_count*100, 2)  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 02:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356806#M5747</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-08-10T02:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356807#M5748</link>
      <description>&lt;P&gt;I'm not sure what the n.0.0 part is but the very fact that the x_pct computations share a common denominator seem to indicate that a specific point was missed... &lt;/P&gt;

&lt;P&gt;Also, and more importantly, there is no breakdown by msg which is the important thing being counted.&lt;/P&gt;

&lt;P&gt;Each msg count needs to be measured by the particular appVersion, then those computations compared against each other.&lt;/P&gt;

&lt;P&gt;This is to see for example, that some message's frequency wrt to one appVersion, has increased/decreased compared to another appVersion. In this case the denominator is the total number of msgs for that particular appVersion, not a global total.&lt;/P&gt;

&lt;P&gt;I added a comment with an example (I didn't see a way to edit my question) but apparently the comment hasn't been cleared by the moderator yet.&lt;/P&gt;

&lt;P&gt;Sorry for any confusion. Please wait for the example to clear if the context is not clear.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 05:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356807#M5748</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-10T05:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356808#M5749</link>
      <description>&lt;P&gt;Note that:&lt;BR /&gt;
     | chart count over appVersion by msg&lt;BR /&gt;
breaks the data down into the numbers needed per msg, appVersion but then the matter is computing and dividing those number by the totals by appVersion&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;appVersion  msg1 msg2 msg3
21.30                  165      802    165
21.33                     4         5     4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the example above the 21.30 total would be 165+802+165=1132 and the 21.33 total would be 4+5+4=13&lt;BR /&gt;
so the percentages would look like&lt;/P&gt;

&lt;P&gt;appVersion  msg1 msg2 msg3&lt;BR /&gt;
21.30             14.5     71    14.5&lt;BR /&gt;
21.33                   31     38    31&lt;/P&gt;

&lt;P&gt;in other words, msg1 and msg3 error rates have increased in version 21.33 whereas msg2 has decreased.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            msg1 msg2 msg3
diff       16.5   -33    16.5 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Aug 2017 06:18:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356808#M5749</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-10T06:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356809#M5750</link>
      <description>&lt;P&gt;I can see calculating percentage diff per msg between appVersion if I tilt the table. I cannot really tilt it back afterwards, but maybe you can live with that?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | eval appVersion="v_"+appVersion | eventstats count as total by appVersion | eventstats count as splitcount by appVersion msg | eval percent=round(splitcount/total*100,2) |  chart values(percent) over msg by appVersion | eval diff =v_21.30 - v_21.33
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I don't know if we need to append v_ to the appVersion for doing the diff calc later),&lt;/P&gt;

&lt;P&gt;That's still not really good because I guess you don't want the appVersion hardcoded, right?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 07:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356809#M5750</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2017-08-10T07:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356810#M5751</link>
      <description>&lt;P&gt;A two version is ok for now thank you, unfortunately i am getting an eval error on the final diff expression: "Error in 'eval' command: Typechecking failed. '-' only takes numbers"... I'm assuming that the generated column names v_21.30 and v_21.33 are not valid because of the "."? But I don't see how to get around it with our version numbers the way they are.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356810#M5751</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2020-09-29T15:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356811#M5752</link>
      <description>&lt;P&gt;Got it, for the two (or limited number), can use if to do the renaming. This provides the diff. Thank you very much!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval appVersion=if(appVersion="21.30","v21_30","v21_33") | eventstats count as total by appVersion | eventstats count as splitcount by appVersion msg | eval percent=round(splitcount/total*100,2) |  chart values(percent) over msg by appVersion | eval diff=(v21_30-v21_33)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Aug 2017 17:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356811#M5752</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-11T17:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Percent by multiple (say 2) fields as in msg and version</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356812#M5753</link>
      <description>&lt;P&gt;So this works well for getting/seeing the basic data.&lt;/P&gt;

&lt;P&gt;What I actually want to do is have this visualized over time with each line representing a specific msg, and the value being the diff value for that day.&lt;/P&gt;

&lt;P&gt;I'm getting stumped on how to bucket/bin this data per day and have it visualized.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 20:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Percent-by-multiple-say-2-fields-as-in-msg-and-version/m-p/356812#M5753</guid>
      <dc:creator>pyamamoto</dc:creator>
      <dc:date>2017-08-11T20:39:44Z</dc:date>
    </item>
  </channel>
</rss>

