<?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: How do I remove 2 decimal places from values returned in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-2-decimal-places-from-values-returned-in-a/m-p/206598#M187723</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats ... | eval Critical=round(Critical,0) | eval Warning=round(Warning,0) | sort ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Oct 2015 11:48:53 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-10-27T11:48:53Z</dc:date>
    <item>
      <title>How do I remove 2 decimal places from values returned in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-2-decimal-places-from-values-returned-in-a/m-p/206597#M187722</link>
      <description>&lt;P&gt;When I run the search below, I get correct results without any decimal value in it. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`linux-cpu` | search application=sc10_LMS host=* sub_module=* | stats max(pctLoad) AS pctLoad by host sub_module application | eval Health=if(pctLoad &amp;lt; 50,1,0) | eval Warn=if(pctLoad&amp;gt;= 50 AND pctLoad &amp;lt;80,1,0) | eval Crit=if(pctLoad&amp;gt;=80,1,0) | stats  sum(Crit) as Critical sum(Warn) as Warning sum(Health) as Healthy dc(host) as Total by sub_module | sort - Critical Warning

sub_module  Critical    Warning     Healthy     Total
sc10_LMS_A      4          4         12         20 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I put the same search in my dashboard which takes arguments from the drop-down like below, it gives me a result with decimal values only for Critical and Warning. How can I get rid of this decimal value?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`linux-cpu` | search application=$application$ host=$host$ sub_module=$submodule$ | stats $function$(pctLoad) AS pctLoad by host sub_module application | eval Health=if(pctLoad &amp;lt; 50,1,0) | eval Warn=if(pctLoad&amp;gt;= 50 AND pctLoad &amp;lt;80,1,0) | eval Crit=if(pctLoad&amp;gt;=80,1,0) | stats  sum(Crit) as Critical sum(Warn) as Warning sum(Health) as Healthy dc(host) as Total by sub_module | sort - Critical Warning

sub_module  Critical    Warning     Healthy     Total
sc10_LMS_A       4.00        4.00      12         20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2015 09:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-2-decimal-places-from-values-returned-in-a/m-p/206597#M187722</guid>
      <dc:creator>splunksurekha</dc:creator>
      <dc:date>2015-10-27T09:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove 2 decimal places from values returned in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-2-decimal-places-from-values-returned-in-a/m-p/206598#M187723</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats ... | eval Critical=round(Critical,0) | eval Warning=round(Warning,0) | sort ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2015 11:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-2-decimal-places-from-values-returned-in-a/m-p/206598#M187723</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-10-27T11:48:53Z</dc:date>
    </item>
  </channel>
</rss>

