<?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 Help using eval case statement using wildcards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378292#M110899</link>
    <description>&lt;P&gt;I'm trying to create a new field for category based off values in my existing 'message' field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=test
| eval category = case (like(message,"*port scan detected*"), "Network_Port_Scan", like(message,"Gateway Anti-Virus Alert*"), like(message,"*Possible TCP Flood*")), "Network_Threat_Activity", like(message,"*packet dropped*" like(message,"*connection dropped*" like(message,"*protocol dropped*"))), "Network_Wire_Activity")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anyone know how I accomplish this?&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 23:06:08 GMT</pubDate>
    <dc:creator>johnward4</dc:creator>
    <dc:date>2019-05-17T23:06:08Z</dc:date>
    <item>
      <title>Help using eval case statement using wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378292#M110899</link>
      <description>&lt;P&gt;I'm trying to create a new field for category based off values in my existing 'message' field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=test
| eval category = case (like(message,"*port scan detected*"), "Network_Port_Scan", like(message,"Gateway Anti-Virus Alert*"), like(message,"*Possible TCP Flood*")), "Network_Threat_Activity", like(message,"*packet dropped*" like(message,"*connection dropped*" like(message,"*protocol dropped*"))), "Network_Wire_Activity")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anyone know how I accomplish this?&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 23:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378292#M110899</guid>
      <dc:creator>johnward4</dc:creator>
      <dc:date>2019-05-17T23:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help using eval case statement using wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378293#M110900</link>
      <description>&lt;P&gt;Asterisks are wild only for &lt;CODE&gt;search&lt;/CODE&gt; and base searches.  For &lt;CODE&gt;eval&lt;/CODE&gt; and &lt;CODE&gt;where&lt;/CODE&gt;, they are string literals so you &lt;STRONG&gt;MUST&lt;/STRONG&gt; use something else like, &lt;CODE&gt;like()&lt;/CODE&gt; or &lt;CODE&gt;match()&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 23:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378293#M110900</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-17T23:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help using eval case statement using wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378294#M110901</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; can I using OR operators inside a given like() statement?&lt;/P&gt;

&lt;P&gt;example : &lt;/P&gt;

&lt;P&gt;| eval category = case (like(message,"%port scan detected%"), "Network_Port_Scan", like(message,"%Gateway Anti-Virus Alert%" OR "%TCP Flood%"), "Network_Threat_Activity")&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:35:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378294#M110901</guid>
      <dc:creator>johnward4</dc:creator>
      <dc:date>2020-09-30T00:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help using eval case statement using wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378295#M110902</link>
      <description>&lt;P&gt;No but you can &lt;CODE&gt;like() OR like()&lt;/CODE&gt; and you can use SQL boolean syntax or use &lt;CODE&gt;match(message, "foo|bar|bat")&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 00:13:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-eval-case-statement-using-wildcards/m-p/378295#M110902</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-18T00:13:49Z</dc:date>
    </item>
  </channel>
</rss>

