<?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: Getting incorrect values while using Eval and eventstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111633#M29257</link>
    <description>&lt;P&gt;What are the different values of Churn? Is it True or True. ? Can you try stats values(Churn) before | eval Churn = if(Churn="True.","1","0")?&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2015 10:35:20 GMT</pubDate>
    <dc:creator>vganjare</dc:creator>
    <dc:date>2015-05-15T10:35:20Z</dc:date>
    <item>
      <title>Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111622#M29246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I had count of some condition and aggregated data. using both I stored them in some variable using eval. then that  variable is used for stats or geostats. but I am getting less value than the actual value. &lt;BR /&gt;
below is the query I have used. any thing i have missed.?&lt;BR /&gt;
** sourcetype="Churn_csv"&lt;BR /&gt;
| eval Churn = if(Churn="True.","1","0")&lt;BR /&gt;
| eventstats sum(Churn) as total_churn&lt;BR /&gt;
| eval prop= Churn*100  / total_churn &lt;BR /&gt;
| stats sum(prop) by state**&lt;/P&gt;

&lt;P&gt;actually my aim is to get " count(churn=true)*100/count(churn) for each state " this data to be displayed in geostats chart.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;BR /&gt;
Santhosh.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111622#M29246</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111623#M29247</link>
      <description>&lt;P&gt;Try chaning following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventstats sum(Churn) as total_churn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As the Churn is classified as 1 and 0, the sum will give you the total for Churun==true. Try using count(Churn) for getting the total.&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 09:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111623#M29247</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-15T09:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111624#M29248</link>
      <description>&lt;P&gt;@vganjare , when I am trying it individually in another search, it is showing count of all correctly , but when using it with above query it is not showing correct values. What would be the problem. I am very confused. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
example:&lt;BR /&gt;
state name:AK&lt;BR /&gt;
churn=true:3&lt;BR /&gt;
total churn:52. &lt;BR /&gt;
when we calculate it should get 5.7692 but here it is showing 0.090009&lt;BR /&gt;
any ideas &lt;/P&gt;

&lt;P&gt;Thanks.&lt;BR /&gt;
Santhosh.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 09:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111624#M29248</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2015-05-15T09:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111625#M29249</link>
      <description>&lt;P&gt;Can you please provide the query used in another search? Here, I think, you are calculating the % churn by state.&lt;/P&gt;

&lt;P&gt;Also, the above query can be written in below format:&lt;BR /&gt;
    sourcetype="Churn_csv"&lt;BR /&gt;
    | eval Churn = if(Churn="True.","1","0")&lt;BR /&gt;
    | stats sum(Churn) as true_churn , count(Churn) as total_churn by state &lt;BR /&gt;
    | eval prop= true_churn*100 / total_churn &lt;BR /&gt;
    | stats sum(prop) by state&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111625#M29249</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2020-09-28T19:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111626#M29250</link>
      <description>&lt;P&gt;here is the query for getting count .&lt;BR /&gt;
&lt;STRONG&gt;source="Churn_DATA_lat_lon.csv" host="LTCPU069-PC" sourcetype="Churn_csv"&lt;BR /&gt;
| eval Churn = if(Churn="True.",1,0)&lt;BR /&gt;
| stats sum(Churn) as total_churn, count(Churn) by state&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;based on your proposed query, it is now showing perfect values, but not able to add geostats.&lt;BR /&gt;
what would be the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111626#M29250</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111627#M29251</link>
      <description>&lt;P&gt;try changing the stats to eventstats. &lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111627#M29251</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-15T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111628#M29252</link>
      <description>&lt;P&gt;yes, perfect.!!!&lt;BR /&gt;
splunk is very complicated !!&lt;BR /&gt;
sorry for making you so pinpointed and make you to answer silly Q?'s &lt;BR /&gt;
I am very very new and purely self learning guy from my firm.( my domain is SAP BO ) actuallly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
anyway thanks a lot.!!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111628#M29252</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2015-05-15T10:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111629#M29253</link>
      <description>&lt;P&gt;@vganjare I have changed stats to eventstats, but didnt kept geostats, i have used stats instead, it shown me different values. then after keeping geostats, it shown the perfect values, can you please explain me the actual reason behind it.?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:08:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111629#M29253</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2015-05-15T10:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111630#M29254</link>
      <description>&lt;P&gt;Glad that I could help!!&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111630#M29254</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-15T10:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111631#M29255</link>
      <description>&lt;P&gt;I suspect, the geostats command tries to add/extract the information for the location (for mapping purpose). I dont expect any differences in the results computed by stats vs eventstats. Most likely, it should not happen. You can read the details of geostats at &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Geostats"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Geostats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111631#M29255</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-15T10:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111632#M29256</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140538"&gt;@vganjare&lt;/a&gt; , one more inconsistency again &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
it is showing some more values with correct values.&lt;BR /&gt;
source="Churn_DATA_lat_lon.csv" host="LTCPU069-PC" sourcetype="Churn_csv"&lt;BR /&gt;
| eval Churn = if(Churn="True.","1","0")&lt;BR /&gt;
| eventstats sum(Churn) as true_churn , count(Churn) as total_churn by state &lt;BR /&gt;
| eval prop= true_churn*100 / total_churn &lt;BR /&gt;
| geostats sum(prop) by state globallimit=0&lt;/P&gt;

&lt;P&gt;getting different values in statistics, in geostats chart only incorrect value.&lt;BR /&gt;
please help&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111632#M29256</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111633#M29257</link>
      <description>&lt;P&gt;What are the different values of Churn? Is it True or True. ? Can you try stats values(Churn) before | eval Churn = if(Churn="True.","1","0")?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:35:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111633#M29257</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-15T10:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect values while using Eval and eventstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111634#M29258</link>
      <description>&lt;P&gt;thank god!!&lt;BR /&gt;
finally got it on my  own &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
i just changed sum(prop) to values(prop) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;thank you so much for the support.!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 10:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-incorrect-values-while-using-Eval-and-eventstats/m-p/111634#M29258</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2015-05-15T10:57:38Z</dc:date>
    </item>
  </channel>
</rss>

