<?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: How do I match based on multiple values using eval and like command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545378#M154464</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225682"&gt;@ezmo1982&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use case statement;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval os_group=case(like(operating_system, "%Server%", "Server",like(operating_system, "%Windows 7%", "Workstation", 1=1, os_group)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 25 Mar 2021 12:55:34 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2021-03-25T12:55:34Z</dc:date>
    <item>
      <title>How do I match based on multiple values using eval and like command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545376#M154462</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a field named operating_system. it can contain multiple values examples being "Windows 10", "Windows Server 2016", "Windows 7" and others.&lt;/P&gt;&lt;P&gt;I want to set a field named os_group based on the value of operating_system. So if the value operating_system value contains "Windows Server*" i want to set the os_group to "Server". If the value of operating_system is "Windows 7", "Windows 8", or "Windows 10", I want to set os_group to "Workstation"&lt;/P&gt;&lt;P&gt;I was trying to do it using seperate lines as below. But can i combine these into one eval function where i can specify multiple values to filter on? I will need to use wildcards.&lt;/P&gt;&lt;P&gt;| eval os_group=if(like(operating_system, "%Server%", "Server", os_group)&lt;BR /&gt;| eval os_group=if(like(operating_system, "%Windows 7%", "Workstation", os_group)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 12:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545376#M154462</guid>
      <dc:creator>ezmo1982</dc:creator>
      <dc:date>2021-03-25T12:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I match based on multiple values using eval and like command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545378#M154464</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225682"&gt;@ezmo1982&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use case statement;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval os_group=case(like(operating_system, "%Server%", "Server",like(operating_system, "%Windows 7%", "Workstation", 1=1, os_group)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Mar 2021 12:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545378#M154464</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-25T12:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I match based on multiple values using eval and like command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545639#M154602</link>
      <description>&lt;P&gt;Missing a ")" at the end of "%Server%" but apart from your spl does the job, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 18:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-match-based-on-multiple-values-using-eval-and-like/m-p/545639#M154602</guid>
      <dc:creator>ezmo1982</dc:creator>
      <dc:date>2021-03-26T18:10:53Z</dc:date>
    </item>
  </channel>
</rss>

