<?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 remove decimal places without rounding in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362802#M163945</link>
    <description>&lt;P&gt;Perfect! Thank you Burch&lt;BR /&gt;
And yes, I'd rather fish  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2018 16:36:38 GMT</pubDate>
    <dc:creator>g038123</dc:creator>
    <dc:date>2018-01-09T16:36:38Z</dc:date>
    <item>
      <title>How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362794#M163937</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have the following field values returned from a base search&lt;/P&gt;

&lt;P&gt;Field Name&lt;BR /&gt;
14.2&lt;BR /&gt;
19.95&lt;BR /&gt;
InvalidCompositeMsmtA&lt;BR /&gt;
0&lt;BR /&gt;
5.6&lt;BR /&gt;
CompositeIndexInitializing&lt;/P&gt;

&lt;P&gt;I need to remove the decimal places without rounding, so the results show as below, which would match what our application displays.&lt;/P&gt;

&lt;P&gt;Field Name&lt;BR /&gt;
14&lt;BR /&gt;
19&lt;BR /&gt;
InvalidCompositeMsmtA&lt;BR /&gt;
0&lt;BR /&gt;
5&lt;BR /&gt;
CompositeIndexInitializing&lt;/P&gt;

&lt;P&gt;Thank you in advance for any assistance you can provide.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 21:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362794#M163937</guid>
      <dc:creator>g038123</dc:creator>
      <dc:date>2018-01-04T21:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362795#M163938</link>
      <description>&lt;P&gt;You are looking on something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval InvalidCompositeMsmtA=floor(InvalidCompositeMsmtA)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can find the documentation about floor &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/MathematicalFunctions#floor.28X.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/MathematicalFunctions#floor.28X.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 23:00:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362795#M163938</guid>
      <dc:creator>outcoldman</dc:creator>
      <dc:date>2018-01-04T23:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362796#M163939</link>
      <description>&lt;P&gt;The output format you've put may be little confusing. What are the names of the fields that contains those decimal values? Are the names of those columns fixed/static? There is a function called &lt;CODE&gt;floor&lt;/CODE&gt; which can just bring it down to next lower integer number (no rounding, floor(19.99) will be 19 ).&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 23:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362796#M163939</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-04T23:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362797#M163940</link>
      <description>&lt;P&gt;Floor, ceiling, round, or if needed, you could string parse it to chop off everything from decimal after. As @somesoni2 highlight, the formatting of the original post is funky so it's a bit hard to understand if these answers are helping.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 13:22:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362797#M163940</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2018-01-05T13:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362798#M163941</link>
      <description>&lt;P&gt;Hey, sorry for the confusion, to clarify I have a field named "Index"(Named "Field Name" in original post)&lt;BR /&gt;
The values of the Index field can be numeric or string as below&lt;BR /&gt;
14.2&lt;BR /&gt;
19.95&lt;BR /&gt;
InvalidCompositeMsmtA&lt;BR /&gt;
0&lt;BR /&gt;
5.6&lt;BR /&gt;
CompositeIndexInitializing&lt;/P&gt;

&lt;P&gt;I don't really care about the strings, they're temporary and will update to a numeric value after enough readings have posted.  For the purposes of my report, they will generally be ignored.&lt;/P&gt;

&lt;P&gt;I do care about the numeric values and would like them to display identical to what is displayed on our application. Floor worked perfectly as I do not want the values rounded, thank you for that!&lt;/P&gt;

&lt;P&gt;Given the same data values, if I did need to only update the numeric values and leave the strings untouched, how would I do that? Just curious for future reference and if by chance the requester of the data asks for it. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 15:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362798#M163941</guid>
      <dc:creator>g038123</dc:creator>
      <dc:date>2018-01-05T15:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362799#M163942</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search | eval "Field Name"=if(match('Field Name',"^[\d\.]*$"),floor('Field Name'),'Field Name')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2018 15:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362799#M163942</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-05T15:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362800#M163943</link>
      <description>&lt;P&gt;Perfect, Thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 19:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362800#M163943</guid>
      <dc:creator>g038123</dc:creator>
      <dc:date>2018-01-05T19:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362801#M163944</link>
      <description>&lt;P&gt;Check the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions#Supported_functions_and_syntax"&gt;functions for the eval command&lt;/A&gt; and you will discover that you can play with Informational Functions and the Comparison and Conditional functions to test if a value is a string (hint: isstr ) or is a number (hint: isnum ) and then perform the floor only on the numbers.&lt;/P&gt;

&lt;P&gt;If you need more help, come back here, but I figured you wanted to learn more about the options available than just this specific answer (teach you to fish).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 12:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362801#M163944</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2018-01-08T12:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362802#M163945</link>
      <description>&lt;P&gt;Perfect! Thank you Burch&lt;BR /&gt;
And yes, I'd rather fish  &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 16:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362802#M163945</guid>
      <dc:creator>g038123</dc:creator>
      <dc:date>2018-01-09T16:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362803#M163946</link>
      <description>&lt;P&gt;i tried doing this way, i want t remove decimal places without rounding. but this did nt work&lt;/P&gt;

&lt;P&gt;index=xyx host=* source=&lt;EM&gt;abc&lt;/EM&gt; &lt;BR /&gt;
| eval new_time = uptime/86400 | timechart span=1day avg(new_time) as Days by host| eval Days=if(match('Days',"^[\d.]*$"),floor('Days'),'Days')&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362803#M163946</guid>
      <dc:creator>vikashperiwal</dc:creator>
      <dc:date>2020-09-30T00:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal places without rounding</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362804#M163947</link>
      <description>&lt;P&gt;@vikashperiwal - time is a bit "fun" to play with and I suggest making a whole new post for that question (and then share the link here so we can help you) so we can dive deep with you.&lt;/P&gt;

&lt;P&gt;There could be a number of options or approaches depending on your situation. For example, your question could be solved with a tweak to the sourcetype (to modify the &lt;EM&gt;time) that could solve your challenge with the `date&lt;/EM&gt;*` fields.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 15:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-decimal-places-without-rounding/m-p/362804#M163947</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2019-07-02T15:44:57Z</dc:date>
    </item>
  </channel>
</rss>

