<?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 this newly created field (via eval) not produce any values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567426#M197741</link>
    <description>&lt;P&gt;Beautiful! Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnnydunlop_0-1631886525426.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16038iBF9FA4E3AA54BCC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnnydunlop_0-1631886525426.png" alt="johnnydunlop_0-1631886525426.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 13:48:57 GMT</pubDate>
    <dc:creator>johnnydunlop</dc:creator>
    <dc:date>2021-09-17T13:48:57Z</dc:date>
    <item>
      <title>Why does this newly created field (via eval) not produce any values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567404#M197728</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have written the below search query based on some prometheus metrics being onboarded:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=lab_openshift_prometheus sourcetype=openshift_prometheus metric_name=ceph_cluster_total_bytes | eval ceph_cluster_total_bytes_decimal = round(v,0)
| append [ search  index=lab_openshift_prometheus sourcetype=openshift_prometheus metric_name=ceph_cluster_total_used_bytes | eval ceph_cluster_total_used_bytes_decimal = round(v,0) ]
| eval aaa = ceph_cluster_total_bytes_decimal - ceph_cluster_total_used_bytes_decimal / ceph_cluster_total_bytes_decimal
| table aaa&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what I want to do is:&lt;BR /&gt;convert each metric's V field (value) from scientific notation to decimal (rounding to 2 decimal places)&lt;BR /&gt;Do some arithmetic on the new decimal values and create a new field based on the result&lt;BR /&gt;&lt;BR /&gt;I am able to create the new decimal value fields but when I do the arithmetic on them, the new aaa field does not contain any data:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnnydunlop_0-1631881117604.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16034iBA7B391F111012EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnnydunlop_0-1631881117604.png" alt="johnnydunlop_0-1631881117604.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with what I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 12:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567404#M197728</guid>
      <dc:creator>johnnydunlop</dc:creator>
      <dc:date>2021-09-17T12:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this newly created field (via eval) not produce any values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567414#M197733</link>
      <description>&lt;P&gt;When the result of an &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; is null it's usually because at least one of the fields in the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; is null.&amp;nbsp; In the screen shot, there are two separate events, each with one field used in the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; therefore, the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; does not have enough information to calculate aaa.&lt;/P&gt;&lt;P&gt;Use the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command to combine the events then compute aaa.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=lab_openshift_prometheus sourcetype=openshift_prometheus metric_name=ceph_cluster_total_bytes | eval ceph_cluster_total_bytes_decimal = round(v,0)
| append [ search  index=lab_openshift_prometheus sourcetype=openshift_prometheus metric_name=ceph_cluster_total_used_bytes | eval ceph_cluster_total_used_bytes_decimal = round(v,0) ]
| stats sum(*) as * 
| eval aaa = ceph_cluster_total_bytes_decimal - ceph_cluster_total_used_bytes_decimal / ceph_cluster_total_bytes_decimal
| table aaa&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567414#M197733</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-09-17T13:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this newly created field (via eval) not produce any values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567426#M197741</link>
      <description>&lt;P&gt;Beautiful! Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnnydunlop_0-1631886525426.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16038iBF9FA4E3AA54BCC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnnydunlop_0-1631886525426.png" alt="johnnydunlop_0-1631886525426.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-this-newly-created-field-via-eval-not-produce-any/m-p/567426#M197741</guid>
      <dc:creator>johnnydunlop</dc:creator>
      <dc:date>2021-09-17T13:48:57Z</dc:date>
    </item>
  </channel>
</rss>

