<?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: Round down in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84621#M182059</link>
    <description>&lt;P&gt;The problem with that is I want it to round DOWN not just round. That function doesn't let me do that as far as I know.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jun 2012 20:16:35 GMT</pubDate>
    <dc:creator>KaliBaker</dc:creator>
    <dc:date>2012-06-26T20:16:35Z</dc:date>
    <item>
      <title>Round down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84619#M182057</link>
      <description>&lt;P&gt;I have a function where I take a number, divide it by 3, then would like to round that number down. Is that possible to do in Splunk? Could I instead use something like split()? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2012 18:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84619#M182057</guid>
      <dc:creator>KaliBaker</dc:creator>
      <dc:date>2012-06-26T18:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Round down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84620#M182058</link>
      <description>&lt;P&gt;Try the round function:&lt;BR /&gt;
As presented in the documentation:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;round(X,Y): This function takes one or two numeric arguments X and Y, returning X rounded to the amount of decimal places specified by Y. The default is to round to an integer.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This example returns 4:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval test=round(3.5)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This example returns 2.56:&lt;/P&gt;

&lt;P&gt;|eval test=round(2.555, 2) &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2012 19:00:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84620#M182058</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2012-06-26T19:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Round down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84621#M182059</link>
      <description>&lt;P&gt;The problem with that is I want it to round DOWN not just round. That function doesn't let me do that as far as I know.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2012 20:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84621#M182059</guid>
      <dc:creator>KaliBaker</dc:creator>
      <dc:date>2012-06-26T20:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Round down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84622#M182060</link>
      <description>&lt;P&gt;Use eval's floor function.&lt;/P&gt;

&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
| eval foo=floor(Value/3)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;This gives you an integer, but if you really need to maintain some decimal places you could do some extra math, like eval foo=(floor(Value*100/3))/100 to get 2 places.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2012 21:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84622#M182060</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2012-06-26T21:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Round down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84623#M182061</link>
      <description>&lt;P&gt;You will need the floor function. If you use round it will round up your number if the decimal is greater or equal to .5. And it will round down if you decimal is less than .5. Example:&lt;/P&gt;

&lt;P&gt;your query|eval x=7/3 |eval x_round=round(x)|eval  x_floor=floor(x) |table x x_round x_floor&lt;/P&gt;

&lt;P&gt;Result set:&lt;/P&gt;

&lt;P&gt;x   x_round     x_floor&lt;BR /&gt;
2.333333    2   2&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Round-down/m-p/84623#M182061</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2020-09-28T11:59:51Z</dc:date>
    </item>
  </channel>
</rss>

