<?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 Error while creating eval expression for calculated fields in data models in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488059#M136371</link>
    <description>&lt;P&gt;I have a data model and defined about 5 fields. But one of the fields doesnt always have a value. I want it to show as "null" when there is no value in the log. So for this particular field, I created it as a calculated field(systemid) and gave an eval expression     &lt;STRONG&gt;systemid=if(isnull(systemid),"NULL",systemid)&lt;/STRONG&gt;. Now I get the error "Error in 'eval' command: Fields cannot be assigned a boolean result. Instead, try if([bool expr], [expr], [expr])."&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 19:16:47 GMT</pubDate>
    <dc:creator>pdantuuri0411</dc:creator>
    <dc:date>2019-09-19T19:16:47Z</dc:date>
    <item>
      <title>Error while creating eval expression for calculated fields in data models</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488059#M136371</link>
      <description>&lt;P&gt;I have a data model and defined about 5 fields. But one of the fields doesnt always have a value. I want it to show as "null" when there is no value in the log. So for this particular field, I created it as a calculated field(systemid) and gave an eval expression     &lt;STRONG&gt;systemid=if(isnull(systemid),"NULL",systemid)&lt;/STRONG&gt;. Now I get the error "Error in 'eval' command: Fields cannot be assigned a boolean result. Instead, try if([bool expr], [expr], [expr])."&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 19:16:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488059#M136371</guid>
      <dc:creator>pdantuuri0411</dc:creator>
      <dc:date>2019-09-19T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error while creating eval expression for calculated fields in data models</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488060#M136372</link>
      <description>&lt;P&gt;What you have should work.  Try this alternative, however: &lt;CODE&gt;systemid = coalesce(systemid, "NULL")&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488060#M136372</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-19T20:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error while creating eval expression for calculated fields in data models</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488061#M136373</link>
      <description>&lt;P&gt;Thank you for the reply @rickgalloway&lt;/P&gt;

&lt;P&gt;I just copy pasted systemid = coalesce(systemid, "NULL") in eval expression in calculated fields and I get the same error Error in 'eval' command: Fields cannot be assigned a boolean result. Instead, try if([bool expr], [expr], [expr]).&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-while-creating-eval-expression-for-calculated-fields-in/m-p/488061#M136373</guid>
      <dc:creator>pdantuuri0411</dc:creator>
      <dc:date>2019-09-19T20:18:57Z</dc:date>
    </item>
  </channel>
</rss>

