<?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 is eval function not working for calculated field but works when run as a search using two different source type in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367035#M108264</link>
    <description>&lt;P&gt;The field has blank values and date in epoch. This field is from another source type from the same index. The same eval expression works when run as a search but not when run as a calculated field. I doubt I'd calculated can have multiple source types . Can you confirm please ? What other options I have to create a calculated field using multiple source types ? Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2017 12:43:29 GMT</pubDate>
    <dc:creator>LionelRubdi</dc:creator>
    <dc:date>2017-06-21T12:43:29Z</dc:date>
    <item>
      <title>why is eval function not working for calculated field but works when run as a search using two different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367033#M108262</link>
      <description>&lt;P&gt;My calculated field with the following eval function is not returning values &lt;/P&gt;

&lt;P&gt;round(if(svt_due_date=="null",sv_due_date,(svt_due_date - c_isnull_reported_submited_date ))/3600000) &lt;/P&gt;

&lt;P&gt;but when I run the eval expression as a search - it does return a value.&lt;/P&gt;

&lt;P&gt;.....index=abc| eval cc_resolved_sla_hours=round(if(svt_due_date=="null",sv_due_date,(svt_due_date - c_isnull_reported_submited_date ))/3600000) &lt;/P&gt;

&lt;P&gt;I have tried using host, source type as itam* and also the source type. The svt_due_date is from another source type from the same index (the resulting value is calculation from 2 source types from the same index). I have also tried “sourcetype=itam_inc_xml OR sourcetype=itam_sla_xml” in the calculated field which did not work.&lt;/P&gt;

&lt;P&gt;Is there something I may be missing or creating the calculated fields incorrectly?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367033#M108262</guid>
      <dc:creator>LionelRubdi</dc:creator>
      <dc:date>2020-09-29T14:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: why is eval function not working for calculated field but works when run as a search using two different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367034#M108263</link>
      <description>&lt;P&gt;does svt_due_date actually have a "null" value or is it a blank/null field value? try replacing with &lt;CODE&gt;isnull(svt_due_date)&lt;/CODE&gt; if it is actually a null value&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:37:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367034#M108263</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T14:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: why is eval function not working for calculated field but works when run as a search using two different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367035#M108264</link>
      <description>&lt;P&gt;The field has blank values and date in epoch. This field is from another source type from the same index. The same eval expression works when run as a search but not when run as a calculated field. I doubt I'd calculated can have multiple source types . Can you confirm please ? What other options I have to create a calculated field using multiple source types ? Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 12:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367035#M108264</guid>
      <dc:creator>LionelRubdi</dc:creator>
      <dc:date>2017-06-21T12:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: why is eval function not working for calculated field but works when run as a search using two different source type</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367036#M108265</link>
      <description>&lt;P&gt;You query would work only if all the fields that you are using in the eval expression are under the same sourcetype/source/host based on the stanza that you are using in your props.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 13:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-is-eval-function-not-working-for-calculated-field-but-works/m-p/367036#M108265</guid>
      <dc:creator>thirumalreddyb</dc:creator>
      <dc:date>2017-06-21T13:29:34Z</dc:date>
    </item>
  </channel>
</rss>

