<?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 to include two 'like' eval expressions in splunk in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411889#M4861</link>
    <description>&lt;P&gt;The first &lt;CODE&gt;eval&lt;/CODE&gt; loses the the original text in 'message'.  Later &lt;CODE&gt;eval&lt;/CODE&gt;s need to refer to 'message' as well.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval logins=if(like(message,"Login%"),"is_login","is_not_login") | eval action=case(like(message,"Login failed%") AND logins=="is_login", "Failure", NOT like(message,"Login failed%") AND logins=="is_login", "Success", 1=1, "")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 18 May 2018 04:11:23 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-05-18T04:11:23Z</dc:date>
    <item>
      <title>How to include two 'like' eval expressions in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411887#M4859</link>
      <description>&lt;P&gt;I am working on eval expression. I have a set of data and I want to evaluate a field such that I only extract login authentication messages. &lt;BR /&gt;
The following search string helps to extract only logins:&lt;BR /&gt;
&lt;STRONG&gt;| eval logins=if(like(message,"Login%"),"is_login","is_not_login")&lt;/STRONG&gt;&lt;BR /&gt;
is_login :84 events (failed and successful login events)&lt;BR /&gt;
is_not_login: 551 events (all other events)&lt;BR /&gt;
I would like to create a second eval expression where I zoom in on "is_login" field and further split the values into two.&lt;BR /&gt;
&lt;STRONG&gt;|eval action=if(like(is_login,"Login failed%"),"Failure","Success")&lt;/STRONG&gt;&lt;BR /&gt;
No Failure value in 'action' field.&lt;BR /&gt;
Success: 635 events (whole log file events)&lt;BR /&gt;
I expect to get a field 'action' with two values within it, Failure and Success. However I only get one Success value which represents all events from the log file itself. &lt;/P&gt;

&lt;P&gt;Combined eval search:&lt;BR /&gt;
 &lt;STRONG&gt;| eval logins=if(like(message,"Login%"),"is_login","is_not_login") |eval action=if(like(is_login,"Login failed%"),"Failure","Success")&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I need help to see if my logic is correct, the first eval seperates login events from all other events, the second eval further divides the failed and successful login events. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411887#M4859</guid>
      <dc:creator>gilbxrtx_7</dc:creator>
      <dc:date>2020-09-29T19:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to include two 'like' eval expressions in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411888#M4860</link>
      <description>&lt;P&gt;Logins has two values is_login and is_not_login. So in second event you cant perform eval on values, "like" function work on fields not on values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411888#M4860</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2020-09-29T19:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to include two 'like' eval expressions in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411889#M4861</link>
      <description>&lt;P&gt;The first &lt;CODE&gt;eval&lt;/CODE&gt; loses the the original text in 'message'.  Later &lt;CODE&gt;eval&lt;/CODE&gt;s need to refer to 'message' as well.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval logins=if(like(message,"Login%"),"is_login","is_not_login") | eval action=case(like(message,"Login failed%") AND logins=="is_login", "Failure", NOT like(message,"Login failed%") AND logins=="is_login", "Success", 1=1, "")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 May 2018 04:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-include-two-like-eval-expressions-in-splunk/m-p/411889#M4861</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-05-18T04:11:23Z</dc:date>
    </item>
  </channel>
</rss>

