<?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 splunk eval case statement compare the case-sensitive value or  case-insensitive in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393765#M114475</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I have a very small conceptual doubt. Does the eval case do case insensitive compare or will it compare the exact values (Case sensitive only)? I need a case-insensitive comparison here. &lt;/P&gt;

&lt;P&gt;LINE_CODE value examples:- AMx05323, amy4bl124, bmz4265678 etc. If the first Character is a or A (case insensitive "a", it should return Atlanta otherwise it should return Other.&lt;BR /&gt;&lt;BR /&gt;
Do the following 2 statements will provide the same results or different. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval REGION_ID = (substr(LINE_CODE,1,1)="a") OR (substr(LINE_CODE,1,1)="A")) ,"Atlanta", 1=1,"Other") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval REGION_ID = substr(LINE_CODE,1,1)="a"  ,"Atlanta" , 1=1," Other") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your time. &lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 09:15:04 GMT</pubDate>
    <dc:creator>Chandras11</dc:creator>
    <dc:date>2018-05-09T09:15:04Z</dc:date>
    <item>
      <title>splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393765#M114475</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I have a very small conceptual doubt. Does the eval case do case insensitive compare or will it compare the exact values (Case sensitive only)? I need a case-insensitive comparison here. &lt;/P&gt;

&lt;P&gt;LINE_CODE value examples:- AMx05323, amy4bl124, bmz4265678 etc. If the first Character is a or A (case insensitive "a", it should return Atlanta otherwise it should return Other.&lt;BR /&gt;&lt;BR /&gt;
Do the following 2 statements will provide the same results or different. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval REGION_ID = (substr(LINE_CODE,1,1)="a") OR (substr(LINE_CODE,1,1)="A")) ,"Atlanta", 1=1,"Other") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval REGION_ID = substr(LINE_CODE,1,1)="a"  ,"Atlanta" , 1=1," Other") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your time. &lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 09:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393765#M114475</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-05-09T09:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393766#M114476</link>
      <description>&lt;P&gt;That's easy enough to test:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval LINE_CODE="Abcd"
| append [
| makeresults
| eval LINE_CODE="abcd"
]
| eval REGION_ID = case(substr(LINE_CODE,1,1)="a","Atlanta", 1=1," Other")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which results in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_CODE   REGION_ID
Abcd    Other
abcd    Atlanta
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Conclusion: it is case sensitive. To make it insensitive, simply cast to lowercase before testing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval REGION_ID = case(lower(substr(LINE_CODE,1,1))="a","Atlanta", 1=1," Other")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 May 2018 09:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393766#M114476</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-09T09:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393767#M114477</link>
      <description>&lt;P&gt;Perfect,  thanks for the explanation. is there any way to remove if there is a blank space in from of LINE_CODE for example:- LINE_CODE  = "  Abrd" &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393767#M114477</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2020-09-29T19:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393768#M114478</link>
      <description>&lt;P&gt;Take a look at the &lt;CODE&gt;trim()&lt;/CODE&gt; command: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/TextFunctions#trim.28X.2CY.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/TextFunctions#trim.28X.2CY.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 09:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393768#M114478</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-09T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393769#M114479</link>
      <description>&lt;P&gt;Thanks a lot.. It looks like the excel TRIM function. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I can go ahead easily now &lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 09:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393769#M114479</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-05-09T09:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: splunk eval case statement compare the case-sensitive value or  case-insensitive</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393770#M114480</link>
      <description>&lt;P&gt;By default, the lookups are case-insensitive but if you create a &lt;CODE&gt;Lookup definition&lt;/CODE&gt; mapped to your &lt;CODE&gt;Lookup file&lt;/CODE&gt; then you can specify MANY things, including case-sensitive vs. case-insensitive and also &lt;CODE&gt;WILDCARD&lt;/CODE&gt; and &lt;CODE&gt;CIDR&lt;/CODE&gt; based fields.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 05:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-eval-case-statement-compare-the-case-sensitive-value-or/m-p/393770#M114480</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-10T05:29:40Z</dc:date>
    </item>
  </channel>
</rss>

