<?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 to round decimal values up to 2 digits after the decimal in a Splunk search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287894#M87143</link>
    <description>&lt;P&gt;You can use the eval command&lt;BR /&gt;
linux-cpu | search application=pc4_BizX host= sub_module= | stats avg(pctIdle) AS pctLoad avg(pctUser) as pctUser avg(pctSystem) as pctSystem avg(pctNice) as pctNice avg(pctIowait) as pctIowait by sub_module | eval sub_module=round(sub_module,2) |eval pctLoad=round(pctLoad,2)   | rename sub_module AS "Sub Module" pctLoad AS "CPU %"&lt;/P&gt;

&lt;P&gt;Reference:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Eval" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Eval&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:42:52 GMT</pubDate>
    <dc:creator>mtranchita</dc:creator>
    <dc:date>2020-09-29T07:42:52Z</dc:date>
    <item>
      <title>How to round decimal values up to 2 digits after the decimal in a Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287893#M87142</link>
      <description>&lt;P&gt;I am using below query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`linux-cpu` | search application=pc4_BizX host=* sub_module=* | stats avg(pctIdle) AS pctLoad avg(pctUser) as pctUser avg(pctSystem) as pctSystem avg(pctNice) as pctNice avg(pctIowait) as pctIowait by sub_module | rename sub_module AS "Sub Module" pctLoad AS "CPU %"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Getting results like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sub Module   CPU %    pctUser    pctSystem   pctNice    pctIowait
pc4_BizX    87.290618   0.000000   1.068261    0.439008   0.000000
pc4_BizX_A   95.066103   0.054263   0.026636    0.544853   0.000155
pc4_BizX_W   98.705398   0.000000   0.019912    0.544605   0.000000 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I round up to 2 digits after the decimal? Here I am getting 6 digits after the decimal. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 11:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287893#M87142</guid>
      <dc:creator>splunksurekha</dc:creator>
      <dc:date>2015-10-26T11:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to round decimal values up to 2 digits after the decimal in a Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287894#M87143</link>
      <description>&lt;P&gt;You can use the eval command&lt;BR /&gt;
linux-cpu | search application=pc4_BizX host= sub_module= | stats avg(pctIdle) AS pctLoad avg(pctUser) as pctUser avg(pctSystem) as pctSystem avg(pctNice) as pctNice avg(pctIowait) as pctIowait by sub_module | eval sub_module=round(sub_module,2) |eval pctLoad=round(pctLoad,2)   | rename sub_module AS "Sub Module" pctLoad AS "CPU %"&lt;/P&gt;

&lt;P&gt;Reference:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Eval" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Eval&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287894#M87143</guid>
      <dc:creator>mtranchita</dc:creator>
      <dc:date>2020-09-29T07:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to round decimal values up to 2 digits after the decimal in a Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287895#M87144</link>
      <description>&lt;P&gt;Thanks it worked !!!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 12:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-decimal-values-up-to-2-digits-after-the-decimal-in/m-p/287895#M87144</guid>
      <dc:creator>splunksurekha</dc:creator>
      <dc:date>2015-10-26T12:41:11Z</dc:date>
    </item>
  </channel>
</rss>

