<?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 get Splunk to evaluate numbers without a leading digit before the decimal? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-Splunk-to-evaluate-numbers-without-a-leading-digit/m-p/177440#M51027</link>
    <description>&lt;P&gt;Test this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined 
| eval apache_cpu_used_numeric=tonumber(apache_cpu_used)
| timechart span=1m sum(apache_cpu_used_numeric) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that doesn't work, it may be that the &lt;CODE&gt;tonumber&lt;/CODE&gt; function doesn't like the missing 0. Then you can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined 
| eval apache_cpu_used_numeric=tonumber("0" . apache_cpu_used)
| timechart span=1m sum(apache_cpu_used_numeric) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you run these searches in Verbose mode, you should be able to see the fields and events even if the timechart doesn't work. Finally, if this solves your problem, you could create a calculated field that makes the numeric conversion for you automatically.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jan 2015 23:14:48 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-01-06T23:14:48Z</dc:date>
    <item>
      <title>How to get Splunk to evaluate numbers without a leading digit before the decimal?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-Splunk-to-evaluate-numbers-without-a-leading-digit/m-p/177439#M51026</link>
      <description>&lt;P&gt;I have my apache servers' mod_status output (/server-status?auto) being pulled into Splunk with a scripted input.  The CPU usage of apache is its own field in the search results as a numeric value.  Problem is the apache servers use less that 1% of CPU when things are normal so the data being pulled into Splunk shows up like &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;apache_cpu_usage=.078852&lt;/LI&gt;
&lt;LI&gt;apache_cpu_usage=.03456&lt;/LI&gt;
&lt;LI&gt;apache_cpu_usage=.11234&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Whenever I run a simple search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined | timechart span=1m sum(apache_cpu_used) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't get any results in the visualization.  Tried changing the Y axis value minimum to be .05 and still nothing.  My guess is Splunk doesn't like the 0 missing before the decimal.  Since the value will show up when apache uses more than 1% CPU it's correct the way it's being input.  What's the best way to get Splunk to evaluate the data with missing leading digits or am I just missing something?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-Splunk-to-evaluate-numbers-without-a-leading-digit/m-p/177439#M51026</guid>
      <dc:creator>DFresh4130</dc:creator>
      <dc:date>2020-09-28T18:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Splunk to evaluate numbers without a leading digit before the decimal?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-Splunk-to-evaluate-numbers-without-a-leading-digit/m-p/177440#M51027</link>
      <description>&lt;P&gt;Test this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined 
| eval apache_cpu_used_numeric=tonumber(apache_cpu_used)
| timechart span=1m sum(apache_cpu_used_numeric) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that doesn't work, it may be that the &lt;CODE&gt;tonumber&lt;/CODE&gt; function doesn't like the missing 0. Then you can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined 
| eval apache_cpu_used_numeric=tonumber("0" . apache_cpu_used)
| timechart span=1m sum(apache_cpu_used_numeric) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you run these searches in Verbose mode, you should be able to see the fields and events even if the timechart doesn't work. Finally, if this solves your problem, you could create a calculated field that makes the numeric conversion for you automatically.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2015 23:14:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-Splunk-to-evaluate-numbers-without-a-leading-digit/m-p/177440#M51027</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-01-06T23:14:48Z</dc:date>
    </item>
  </channel>
</rss>

