<?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: eval case statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/758154#M243255</link>
    <description>&lt;P&gt;This was already suggested &lt;A href="https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420898/highlight/true#M120939" target="_self"&gt;above in 2018&lt;/A&gt;. But an obvious alternative is not: add a line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fillnull sort_field value=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Additionally, it is better to use boolean function&amp;nbsp;&lt;A class="" href="https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.0/evaluation-functions/multivalue-eval-functions#ariaid-title14" target="_blank" rel="noopener"&gt;true()&lt;/A&gt;&amp;nbsp;(which is equivalent to boolean constant in some other languages), instead of a boolean evaluation such as &lt;FONT face="courier new,courier"&gt;1==1&lt;/FONT&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Feb 2026 07:11:51 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2026-02-08T07:11:51Z</dc:date>
    <item>
      <title>eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420897#M120938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Am using case statement to sort the fields according to user requirement and not alphabetically. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval sort_field=case(wd=="SUPPORT",1, wd=="APPLICATION",2, wd=="STORAGE",3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Works well when i have values for all the 3 rows but when i don't have value for a row then that is not visible . How can i make that visible with 0 values against that row.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 10:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420897#M120938</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2018-07-05T10:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420898#M120939</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval sort_field=case(wd=="SUPPORT",1, wd=="APPLICATION",2, wd=="STORAGE",3,1=1, 0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;add default condition and set it's value to zero.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 10:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420898#M120939</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-07-05T10:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420899#M120940</link>
      <description>&lt;P&gt;Whats your full search? Splunk won't show a field in statistics if there is no raw event for it. There are workarounds to it but would need to see your current search to before suggesting anything.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 15:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420899#M120940</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-05T15:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/539054#M152460</link>
      <description>&lt;P&gt;Can you help me, i have the same probleme with this search :&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=index_sqlprod-itrs_toc (severity=2 OR severity=0 OR severity="-1")&lt;BR /&gt;&lt;BR /&gt;| eval ID=Env+"_"+Apps+"_"+Function+"_"+varname&lt;BR /&gt;| addinfo&lt;BR /&gt;| eval periode=info_max_time-info_min_time&lt;BR /&gt;| transaction ID startswith=(severity=2) maxevents=2&lt;BR /&gt;| eval start_time=mvindex(timestamp,0), end_time=mvindex(timestamp,1)&lt;BR /&gt;| stats sum(duration) AS duration_indispo by Function, periode&lt;BR /&gt;| eval Percent_Available = round((periode-duration_indispo)*100/periode,3)&lt;BR /&gt;&lt;BR /&gt;| eval Env = case(&lt;BR /&gt;Function like "%OTMS%", "OTMS Alcatel",&lt;BR /&gt;Function like "%ASC Recorder%", "Enregistrement Téléphonie",&lt;BR /&gt;Function like "%ASC Core%", "ASC Core",&lt;BR /&gt;Function like "%OXE WORLDWIDE%", "OXE WORLDWIDE",&lt;BR /&gt;Function like "%Proxy%", "Téléphonie Alcatel Mobilité",&lt;BR /&gt;Function like "%Environnement Monitor%", "Environnement Monitor",&lt;BR /&gt;Function like "%Traps%", "Traps",&lt;BR /&gt;Function like "%System Management%", "System Management",&lt;BR /&gt;1==1, 100&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;| fillnull value=100.00&lt;BR /&gt;|table Env, Percent_Available&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Works fine when I have values ​​for all rows of each function, but when I don't have a value for any row then the (function) row is not visible. How can I make this visible with 100 values ​​against this row&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:19:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/539054#M152460</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-02-08T21:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/682100#M233055</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your case should end with&amp;nbsp;,1&lt;FONT color="#00FF00"&gt;=&lt;/FONT&gt;1, 100) and not 1&lt;FONT color="#FF0000"&gt;==&lt;/FONT&gt;1,100&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 11:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/682100#M233055</guid>
      <dc:creator>JTS911</dc:creator>
      <dc:date>2024-03-27T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: eval case statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/758154#M243255</link>
      <description>&lt;P&gt;This was already suggested &lt;A href="https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/420898/highlight/true#M120939" target="_self"&gt;above in 2018&lt;/A&gt;. But an obvious alternative is not: add a line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fillnull sort_field value=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Additionally, it is better to use boolean function&amp;nbsp;&lt;A class="" href="https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.0/evaluation-functions/multivalue-eval-functions#ariaid-title14" target="_blank" rel="noopener"&gt;true()&lt;/A&gt;&amp;nbsp;(which is equivalent to boolean constant in some other languages), instead of a boolean evaluation such as &lt;FONT face="courier new,courier"&gt;1==1&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Feb 2026 07:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-case-statement/m-p/758154#M243255</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2026-02-08T07:11:51Z</dc:date>
    </item>
  </channel>
</rss>

