<?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 Command (IF) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568877#M198277</link>
    <description>&lt;P&gt;Currently with help of ( IF &amp;amp; Case ) i am extracting user agent details&amp;nbsp; like ( browser / mobile device / OS family/ OS version ) which is manual work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any work around which helps me to find out user agent , we are using Splunk cloud. We also aware about few app like user agent extraction in Splunk which will not work for Splunk cloud.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Sep 2021 06:08:58 GMT</pubDate>
    <dc:creator>jaibalaraman</dc:creator>
    <dc:date>2021-09-29T06:08:58Z</dc:date>
    <item>
      <title>Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568639#M198168</link>
      <description>&lt;P&gt;Hi Team&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i tried running the below eval command, i am getting some error message often.&lt;/P&gt;&lt;P&gt;I wrote this below command to find out number of Samsung device used in a month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;eval Next= if(match(cs_user_agent, "SM-G980F"),"Samsung Galaxy S20-5G",if(match(cs_user_agent, "SM-G975W"),"Samsung Galaxy S10+",if(match(cs_user_agent, "SM-G935F"),"Samsung Galaxy S7 edge ",if(match(cs_user_agent, "SM-T350"),"Samsung Galaxy Tab",if(match(cs_user_agent, "SM-G950"),"Samsung Galaxy S8",if(match(cs_user_agent, "SM-G998"),"Samsung Galaxy S21 Ultra-5G",if(match(cs_user_agent, "SM-J120Z"),"Samsung Galaxy J1",if(match(cs_user_agent, "SM-A217F"),"Samsung Galaxy A21s",if(match(cs_user_agent, "SM-G988"),"Samsung Galaxy S20 Ultra 5G",if(match(cs_user_agent, "SM-A105G"),"Samsung Galaxy A10",if(match(cs_user_agent, "SM-A525"),"Samsung Galaxy A52",if(match(cs_user_agent, "SM-G991"),"Samsung Galaxy S21 5G",if(match(cs_user_agent, "SM-A225F"),"Samsung Galaxy A22",if(match(cs_user_agent, "SM-A725"),"Samsung Galaxy A72",if(match(cs_user_agent, "SM-G781"),"Samsung Galaxy S20 FE 5G",if(match(cs_user_agent, "SM-F900U"),"Samsung Galaxy Fold",if(match(cs_user_agent, "SM-A326"),"Samsung Galaxy A32 5G",if(match(cs_user_agent, "SM-F700"),"Samsung Galaxy Z Flip3 5G",if(match(cs_user_agent, "SM-A226"),"Samsung Galaxy A22 5G",if(match(cs_user_agent, "SM-N986"),"Samsung Galaxy Note20 Ultra 5G",if(match(cs_user_agent, "SM-A526"),"Samsung Galaxy A52 5G",if(match(cs_user_agent, "SM-A515"),"Samsung Galaxy A51",if(match(cs_user_agent, "SM-A217"),"Samsung Galaxy A21s",if(match(cs_user_agent, "SM-M326"),"Samsung Galaxy M32 5G",if(match(cs_user_agent, "SM-T7"),"Samsung Galaxy Tab S7 FE",if(match(cs_user_agent, "SM-T50"),"Samsung Galaxy Tab A7 10.4",if(match(cs_user_agent, "SM-T50"),"Samsung Galaxy Tab A7 10.4",if(match(cs_user_agent, "SM-T50"),"Samsung Galaxy J7 Prime",if(match(cs_user_agent, "SM-M515"),"Samsung Galaxy M51",if(match(cs_user_agent, "SM-A505"),"Samsung Galaxy A50",if(match(cs_user_agent, "SM-T22"),"Samsung Galaxy Tab A7 Lite",if(match(cs_user_agent, "SM-G930"),"Samsung Galaxy S7",if(match(cs_user_agent, "SM-N960"),"Samsung Galaxy Note9",if(match(cs_user_agent, "SM-J700"),"Samsung Galaxy J7",if(match(cs_user_agent, "SM-G970"),"Samsung Galaxy S10e",if(match(cs_user_agent, "SM-M127"),"Samsung Galaxy M12",if(match(cs_user_agent, "SM-N970"),"Samsung Galaxy Note10",if(match(cs_user_agent, "SM-A115"),"Samsung Galaxy A11",if(match(cs_user_agent, "SM-T87"),"Samsung Galaxy Tab S7",if(match(cs_user_agent, "SM-A315"),"Samsung Galaxy A31",if(match(cs_user_agent, "SM-M315F"),"Samsung Galaxy M31",if(match(cs_user_agent, "SM-A205"),"Samsung Galaxy A20",if(match(cs_user_agent, "SM-J500"),"Samsung Galaxy J5",if(match(cs_user_agent, "SM-T97"),"Samsung Galaxy Tab S7+","other"))))))))))))))))))))))))))))))))))))))))))))&lt;/P&gt;&lt;P&gt;Note - could some one please help me finding out the best way to get the expected outcome from the user agent or please help to avoid the error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 02:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568639#M198168</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-28T02:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568650#M198172</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226870"&gt;@jaibalaraman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest to go with &lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/ConditionalFunctions#case.28.26lt.3Bcondition.26gt.3B.2C_.26lt.3Bvalue.26gt.3B.2C_....29" target="_self"&gt;case&lt;/A&gt; condition instead of if.&lt;/P&gt;&lt;P&gt;Please check below search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval cs_user_agent="-SM-M315F-" 
| eval Next= case(match(cs_user_agent, "SM-G980F"),"Samsung Galaxy S20-5G",match(cs_user_agent, "SM-G975W"),"Samsung Galaxy S10+",match(cs_user_agent, "SM-G935F"),"Samsung Galaxy S7 edge ",match(cs_user_agent, "SM-T350"),"Samsung Galaxy Tab",match(cs_user_agent, "SM-G950"),"Samsung Galaxy S8",match(cs_user_agent, "SM-G998"),"Samsung Galaxy S21 Ultra-5G",match(cs_user_agent, "SM-J120Z"),"Samsung Galaxy J1",match(cs_user_agent, "SM-A217F"),"Samsung Galaxy A21s",match(cs_user_agent, "SM-G988"),"Samsung Galaxy S20 Ultra 5G",match(cs_user_agent, "SM-A105G"),"Samsung Galaxy A10",match(cs_user_agent, "SM-A525"),"Samsung Galaxy A52",match(cs_user_agent, "SM-G991"),"Samsung Galaxy S21 5G",match(cs_user_agent, "SM-A225F"),"Samsung Galaxy A22",match(cs_user_agent, "SM-A725"),"Samsung Galaxy A72",match(cs_user_agent, "SM-G781"),"Samsung Galaxy S20 FE 5G",match(cs_user_agent, "SM-F900U"),"Samsung Galaxy Fold",match(cs_user_agent, "SM-A326"),"Samsung Galaxy A32 5G",match(cs_user_agent, "SM-F700"),"Samsung Galaxy Z Flip3 5G",match(cs_user_agent, "SM-A226"),"Samsung Galaxy A22 5G",match(cs_user_agent, "SM-N986"),"Samsung Galaxy Note20 Ultra 5G",match(cs_user_agent, "SM-A526"),"Samsung Galaxy A52 5G",match(cs_user_agent, "SM-A515"),"Samsung Galaxy A51",match(cs_user_agent, "SM-A217"),"Samsung Galaxy A21s",match(cs_user_agent, "SM-M326"),"Samsung Galaxy M32 5G",match(cs_user_agent, "SM-T7"),"Samsung Galaxy Tab S7 FE",match(cs_user_agent, "SM-T50"),"Samsung Galaxy Tab A7 10.4",match(cs_user_agent, "SM-T50"),"Samsung Galaxy Tab A7 10.4",match(cs_user_agent, "SM-T50"),"Samsung Galaxy J7 Prime",match(cs_user_agent, "SM-M515"),"Samsung Galaxy M51",match(cs_user_agent, "SM-A505"),"Samsung Galaxy A50",match(cs_user_agent, "SM-T22"),"Samsung Galaxy Tab A7 Lite",match(cs_user_agent, "SM-G930"),"Samsung Galaxy S7",match(cs_user_agent, "SM-N960"),"Samsung Galaxy Note9",match(cs_user_agent, "SM-J700"),"Samsung Galaxy J7",match(cs_user_agent, "SM-G970"),"Samsung Galaxy S10e",match(cs_user_agent, "SM-M127"),"Samsung Galaxy M12",match(cs_user_agent, "SM-N970"),"Samsung Galaxy Note10",match(cs_user_agent, "SM-A115"),"Samsung Galaxy A11",match(cs_user_agent, "SM-T87"),"Samsung Galaxy Tab S7",match(cs_user_agent, "SM-A315"),"Samsung Galaxy A31",match(cs_user_agent, "SM-M315F"),"Samsung Galaxy M31",match(cs_user_agent, "SM-A205"),"Samsung Galaxy A20",match(cs_user_agent, "SM-J500"),"Samsung Galaxy J5",match(cs_user_agent, "SM-T97"),"Samsung Galaxy Tab S7+",1=1,"other")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 06:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568650#M198172</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-28T06:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568696#M198192</link>
      <description>&lt;P&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939" target="_self"&gt;&lt;SPAN class="login-bold"&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Thank you for your valuable responce, yes the above case statement its working.&lt;/P&gt;&lt;P&gt;I have a question why the below two line are included in the search "&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval cs_user_agent="-SM-M315F-"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;are they mandatory ..&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568696#M198192</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-28T11:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568697#M198193</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I tried using sort command to display the number from highest to lowest but its not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me on this sorting from descending to ascending.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:06:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568697#M198193</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-28T11:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568698#M198194</link>
      <description>&lt;P&gt;Sorry for multiple response,&lt;/P&gt;&lt;P&gt;Currently with help of ( IF &amp;amp; Case ) i am extracting user agent details&amp;nbsp; like ( browser / mobile device / OS family/ OS version ) which is manual work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any work around which helps me to find out user agent , we are using Splunk cloud. We also aware about few app like user agent extraction in Splunk which will not work for Splunk cloud.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568698#M198194</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-28T11:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568868#M198269</link>
      <description>&lt;P&gt;No&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226870"&gt;@jaibalaraman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is for sample data only. You just take eval statement and put it into your search.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 04:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568868#M198269</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-29T04:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568877#M198277</link>
      <description>&lt;P&gt;Currently with help of ( IF &amp;amp; Case ) i am extracting user agent details&amp;nbsp; like ( browser / mobile device / OS family/ OS version ) which is manual work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any work around which helps me to find out user agent , we are using Splunk cloud. We also aware about few app like user agent extraction in Splunk which will not work for Splunk cloud.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 06:08:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568877#M198277</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-29T06:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568903#M198285</link>
      <description>&lt;P&gt;If I remember correctly, the DAG Execution Exception is not directly related to your syntax. Anyway, you should get more details regarding the error in your job log in job inspector.&lt;/P&gt;&lt;P&gt;And about the query itself - man, it's hugely overcomplicated. Why don't you just use a lookup? Or even better - do an automatic lookup so it fills a "human-readable" type into a separate field.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 09:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/568903#M198285</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-29T09:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Command (IF)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/569027#M198330</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why don't you just use a lookup? Or even better - do an automatic lookup so it fills a "human-readable" type into a separate field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Could you please help me on this,&amp;nbsp; i don't know how to use lookup command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 00:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Command-IF/m-p/569027#M198330</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-09-30T00:05:31Z</dc:date>
    </item>
  </channel>
</rss>

