<?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: Why does my division of two fields return nothing? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371880#M109428</link>
    <description>&lt;P&gt;Shot in the dark, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=* | eval usage=replace('stats.hypervisor_cpu_usage_ppm',"\s+","")/10000 | table host, stats.hypervisor_cpu_usage_ppm, usage | dedup host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Apr 2018 19:03:26 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-30T19:03:26Z</dc:date>
    <item>
      <title>Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371869#M109417</link>
      <description>&lt;P&gt;I have the following query that is inteded to divide the "stats.hypervisor_cpu_ppm" field by 10000 and then show that value in a table. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=* | eval usage=stats.hypervisor_cpu_usage_ppm / 10000 | table host, stats.hypervisor_cpu_usage_ppm, usage | dedup host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run the query, It gives me a table with the host, the values for stats.hypervisor_spu_ppm, and then an empty column for usage. Why is the usage column empty?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371869#M109417</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2020-09-29T19:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371870#M109418</link>
      <description>&lt;P&gt;I believe you need to replace this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval usage=stats.hypervisor_cpu_usage_ppm / 10000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval usage='stats.hypervisor_cpu_usage_ppm' / 10000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk has some quirks about when field names must be wrapped with quotes in order to reference them, and field names with non-alphanumeric characters often trigger those.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371870#M109418</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-30T18:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371871#M109419</link>
      <description>&lt;P&gt;I have tried this, but I get the same empty column. I tried double quotes as well, but that returned an error becuase Splunk read it as a string being divided by a number. &lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:16:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371871#M109419</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2018-04-30T18:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371872#M109420</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=*
| dedup host
| eval usage=$stats.hypervisor_cpu_usage_ppm$ / 10000
| table host, $stats.hypervisor_cpu_usage_ppm$, usage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=*
| dedup host
| eval usage='stats.hypervisor_cpu_usage_ppm' / 10000
| table host, 'stats.hypervisor_cpu_usage_ppm', usage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371872#M109420</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-30T18:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371873#M109421</link>
      <description>&lt;P&gt;Can you post some sample entries that you see for field &lt;CODE&gt;stats.hypervisor_cpu_usage_ppm&lt;/CODE&gt;, before division?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:31:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371873#M109421</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-30T18:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371874#M109422</link>
      <description>&lt;P&gt;Here is an example of entries for that field:&lt;/P&gt;

&lt;P&gt;stats.hypervisor_cpu_usage_ppm&lt;/P&gt;

&lt;P&gt;286690&lt;BR /&gt;
286690&lt;/P&gt;

&lt;P&gt;745400&lt;BR /&gt;
745400&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371874#M109422</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2020-09-29T19:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371875#M109423</link>
      <description>&lt;P&gt;Niether of these worked. In fact, they both resulted in the &lt;CODE&gt;stats.hypervisor_cpu_usage_ppm&lt;/CODE&gt; column being empty as well as the &lt;CODE&gt;usage&lt;/CODE&gt; column&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371875#M109423</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2018-04-30T18:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371876#M109424</link>
      <description>&lt;P&gt;Is that the value of a single field? Is it a multivalue field?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 18:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371876#M109424</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-30T18:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371877#M109425</link>
      <description>&lt;P&gt;Can you try the below &lt;/P&gt;

&lt;P&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=*&lt;BR /&gt;
 | dedup host&lt;BR /&gt;
 | eval usage=tonumber(stats.hypervisor_cpu_usage_ppm) / 10000&lt;BR /&gt;
 | table host, 'stats.hypervisor_cpu_usage_ppm', usage&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371877#M109425</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-09-29T19:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371878#M109426</link>
      <description>&lt;P&gt;No luck, the &lt;CODE&gt;usage&lt;/CODE&gt; column is still empty. also putting the quotes around stats.hypervisor_cpu_usage_ppm like this : &lt;CODE&gt;| table host, 'stats.hypervisor_cpu_usage_ppm&lt;/CODE&gt; causes that column to be empty as well.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371878#M109426</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2020-09-29T19:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371879#M109427</link>
      <description>&lt;P&gt;Please try this and can let us know whether  stats.hypervisor_cpu_usage_ppm has field values populated &lt;/P&gt;

&lt;P&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=* |dedup host |table  stats.hypervisor_cpu_usage_ppm |eval number = 1000 |eval divide =  stats.hypervisor_cpu_usage_ppm/number &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371879#M109427</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-09-29T19:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371880#M109428</link>
      <description>&lt;P&gt;Shot in the dark, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=* | eval usage=replace('stats.hypervisor_cpu_usage_ppm',"\s+","")/10000 | table host, stats.hypervisor_cpu_usage_ppm, usage | dedup host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Apr 2018 19:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371880#M109428</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-30T19:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371881#M109429</link>
      <description>&lt;P&gt;This only returns two columns. The "stats.hypervisor_cpu_usage_ppm" column has its values and then htere is a "divide" column that just has the value 10000. I used you suggestion and tried the following, but it left me with the same problem that I have been having - the "usage" column is empty.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=* |dedup host |eval number = 1000 |eval usage = stats.hypervisor_cpu_usage_ppm/number | table host, stats.hypervisor_cpu_usage_ppm, usage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371881#M109429</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2020-09-29T19:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371882#M109430</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;index=nutanix sourcetype=nutanix_arch stats.hypervisor_cpu_usage_ppm=*&lt;BR /&gt;
 | dedup host | rename stats.hypervisor_cpu_usage_ppm as USAGEPPM&lt;BR /&gt;
 | eval usage=USAGEPPM/ 10000&lt;BR /&gt;
 | table host,USAGEPPM, usage&lt;/P&gt;

&lt;P&gt;basically i have renamed the field stats.hypervisor_cpu_usage_ppm as USAGEPPM&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371882#M109430</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2020-09-29T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371883#M109431</link>
      <description>&lt;P&gt;This does not work either... I don't know why this is happening, it doesn't make much sense.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371883#M109431</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2018-05-02T15:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371884#M109432</link>
      <description>&lt;P&gt;I am running into a similar issue and have discovered that splunk is extracting the field that I'm dividing incorrectly.  I have a field that's something like size=123 in my events, but splunk for some reason grabs user agent string from the events and assigns that to size.  So make sure your stats.hypervisor_cpu_usage_ppm field has actual numerical values that you expect.  I'm still working on fixing my problem, will update here if fixing field extraction fixed the division problem.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371884#M109432</guid>
      <dc:creator>rnayshulis</dc:creator>
      <dc:date>2020-09-29T19:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my division of two fields return nothing?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371885#M109433</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;

&lt;P&gt;I bumped into this thread and noticed this was not solved.&lt;BR /&gt;
If you noticed the fields are presented as string (a not,#) and the tonumber fails due to multiple values in the string.&lt;/P&gt;

&lt;P&gt;Here's the how I found out the solution:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/opt/splunk/etc/system/local/props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[nutanix_arch]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;KV_MODE = none&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;AUTO_KV_JSON = false&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;INDEXED_EXTRACTIONS = JSON&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/610585/json-format-duplicate-value-in-field.html"&gt;https://answers.splunk.com/answers/610585/json-format-duplicate-value-in-field.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Now the field is an interger and you can eval it with the following command:&lt;BR /&gt;
&lt;CODE&gt;|eval usage='stats.hypervisor_cpu_usage_ppm' / 10000&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 11:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-division-of-two-fields-return-nothing/m-p/371885#M109433</guid>
      <dc:creator>aropaltioali</dc:creator>
      <dc:date>2020-05-07T11:47:07Z</dc:date>
    </item>
  </channel>
</rss>

