<?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 Help on eval if from eval case in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-on-eval-if-from-eval-case/m-p/602859#M12950</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;As you can see, I use a first eval in order to rename the field "site"&lt;/P&gt;
&lt;P&gt;From the site renamed, I need to create a new field called "toto" in order to add new information for the field site.&lt;/P&gt;
&lt;P&gt;So I create an eval if command like below but it doesn't work.&lt;/P&gt;
&lt;P&gt;What is wrong please and is there another simple way to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval site=case(site=="BR", "Espace Br", site=="PERI THEATRE", "Espace Périg", 1==1,site)
| stats last(site) as "Espace BP" by s
| eval toto=if("Espace BP"=="Espace Br", "4G") 
| table "Espace BPE" toto &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 18:29:57 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2022-06-23T18:29:57Z</dc:date>
    <item>
      <title>Help on eval if from eval case</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-on-eval-if-from-eval-case/m-p/602859#M12950</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;As you can see, I use a first eval in order to rename the field "site"&lt;/P&gt;
&lt;P&gt;From the site renamed, I need to create a new field called "toto" in order to add new information for the field site.&lt;/P&gt;
&lt;P&gt;So I create an eval if command like below but it doesn't work.&lt;/P&gt;
&lt;P&gt;What is wrong please and is there another simple way to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval site=case(site=="BR", "Espace Br", site=="PERI THEATRE", "Espace Périg", 1==1,site)
| stats last(site) as "Espace BP" by s
| eval toto=if("Espace BP"=="Espace Br", "4G") 
| table "Espace BPE" toto &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 18:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-on-eval-if-from-eval-case/m-p/602859#M12950</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2022-06-23T18:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: help on eval if from eval case</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-on-eval-if-from-eval-case/m-p/602861#M12951</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;if&lt;/FONT&gt; function is comparing two different strings and setting a value only if they are equal.&amp;nbsp; Therefore, toto is always null.&lt;/P&gt;&lt;P&gt;Use single quotes around a field name containing spaces.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval site=case(site=="BR", "Espace Br", site=="PERI THEATRE", "Espace Périg", 1==1,site)
| stats last(site) as "Espace BP" by s
| eval toto=if('Espace BP'=="Espace Br", "4G") 
| table "Espace BPE" toto &lt;/LI-CODE&gt;&lt;P&gt;Better yet, don't use spaces in field names at all.&amp;nbsp; Add a final &lt;FONT face="courier new,courier"&gt;rename&lt;/FONT&gt; command in the query to make the names "pretty".&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 18:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-on-eval-if-from-eval-case/m-p/602861#M12951</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-06-22T18:31:51Z</dc:date>
    </item>
  </channel>
</rss>

