<?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: rename everything not included in case() in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309417#M92815</link>
    <description>&lt;P&gt;@dorgra, I think the answer was including &lt;STRONG&gt;true()&lt;/STRONG&gt; or &lt;STRONG&gt;1==1&lt;/STRONG&gt; condition at the end of the case block, to handled everything else:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;true(),"EverythingElse"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is similar to default condition block when all the other conditions are not true.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Jun 2017 05:01:40 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-06-17T05:01:40Z</dc:date>
    <item>
      <title>rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309411#M92809</link>
      <description>&lt;P&gt;I have eval category=case(false(),'category',like('test',"test_11%"),"11tests",like('test',"test_22%"),"22tests",like('test',"test33%"),"33tests",true(),'test') | &lt;/P&gt;

&lt;P&gt;How would I say to rename everything else not included in case()?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:11:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309411#M92809</guid>
      <dc:creator>zkenaga</dc:creator>
      <dc:date>2020-09-29T14:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309412#M92810</link>
      <description>&lt;P&gt;I'm confused - the "everything else" part of &lt;CODE&gt;case()&lt;/CODE&gt; already is present in your example, the final pair: &lt;CODE&gt;true(), 'test'&lt;/CODE&gt; yielding the value of the field &lt;CODE&gt;test&lt;/CODE&gt; if all other tests are false.&lt;/P&gt;

&lt;P&gt;What do you mean by rename?&lt;/P&gt;

&lt;P&gt;PS: The first pair, &lt;CODE&gt;false(), 'category'&lt;/CODE&gt;, is pointless - &lt;CODE&gt;false()&lt;/CODE&gt; is never true.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 22:49:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309412#M92810</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-05-23T22:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309413#M92811</link>
      <description>&lt;P&gt;I apologize if I wasn't descriptive enough. I have 11tests and 22tests grouped together under a common name, what would be a way I could say, "for everything else, call it &lt;STRONG&gt;this&lt;/STRONG&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 22:52:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309413#M92811</guid>
      <dc:creator>zkenaga</dc:creator>
      <dc:date>2017-05-23T22:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309414#M92812</link>
      <description>&lt;P&gt;I figured it out after reading what you said more carefully... Thank you again&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 23:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309414#M92812</guid>
      <dc:creator>zkenaga</dc:creator>
      <dc:date>2017-05-23T23:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309415#M92813</link>
      <description>&lt;P&gt;Do post what you did as an answer, and mark it as accepted.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 23:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309415#M92813</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-05-23T23:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309416#M92814</link>
      <description>&lt;P&gt;I'm a noob to Splunk and very interested in this question. As a programmer, why not nest the Case statement inside an IF statement?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2017 01:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309416#M92814</guid>
      <dc:creator>dorgra</dc:creator>
      <dc:date>2017-06-17T01:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309417#M92815</link>
      <description>&lt;P&gt;@dorgra, I think the answer was including &lt;STRONG&gt;true()&lt;/STRONG&gt; or &lt;STRONG&gt;1==1&lt;/STRONG&gt; condition at the end of the case block, to handled everything else:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;true(),"EverythingElse"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is similar to default condition block when all the other conditions are not true.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2017 05:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309417#M92815</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-17T05:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309418#M92816</link>
      <description>&lt;P&gt;To amplify what @niketnilay said, wrapping an &lt;CODE&gt;if&lt;/CODE&gt; around a &lt;CODE&gt;case&lt;/CODE&gt; statement, in pretty much any language, is redundant.   The only place it makes sense is in a few ancient languages where the &lt;CODE&gt;switch/case/evaluate/whateveritwascalled&lt;/CODE&gt;  statement is limited to numeric values and the &lt;CODE&gt;if&lt;/CODE&gt; is not -- or by extension, where the main &lt;CODE&gt;switch&lt;/CODE&gt; is based on conditionally jumping instructions due to different values of a single test, and you want the &lt;CODE&gt;if&lt;/CODE&gt; to represent a different test.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2017 17:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309418#M92816</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-17T17:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: rename everything not included in case()</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309419#M92817</link>
      <description>&lt;P&gt;Just to put the correct answer in writing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval category=case(false(),'category',like('test',"test_11%"),"11tests",like('test',"test_22%"),"22tests",like('test',"test33%"),"33tests",1==1,'everything_else')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Sep 2017 14:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-everything-not-included-in-case/m-p/309419#M92817</guid>
      <dc:creator>mengler_splunk</dc:creator>
      <dc:date>2017-09-01T14:34:04Z</dc:date>
    </item>
  </channel>
</rss>

