<?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 How to use AND in an eval case function? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276088#M83285</link>
    <description>&lt;P&gt;I need a way of using AND in the eval function case.&lt;/P&gt;

&lt;P&gt;For Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...mysearch | eval Path = case(Path=="my/path" AND Action=="check", "Yours is available", Path=="your/path" AND Action=="didnotcheck", "Mine is available" )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This did not work for me, so it seems I am doing something wrong. Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2016 03:16:06 GMT</pubDate>
    <dc:creator>ibekacyril</dc:creator>
    <dc:date>2016-04-06T03:16:06Z</dc:date>
    <item>
      <title>How to use AND in an eval case function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276088#M83285</link>
      <description>&lt;P&gt;I need a way of using AND in the eval function case.&lt;/P&gt;

&lt;P&gt;For Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...mysearch | eval Path = case(Path=="my/path" AND Action=="check", "Yours is available", Path=="your/path" AND Action=="didnotcheck", "Mine is available" )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This did not work for me, so it seems I am doing something wrong. Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 03:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276088#M83285</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-06T03:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use AND in an eval case function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276089#M83286</link>
      <description>&lt;P&gt;How to use the AND is not wrong. Please tell me the contents of the mistake of the search results.&lt;/P&gt;

&lt;P&gt;&amp;lt; search results&amp;gt;&lt;BR /&gt;
Path=="my/path" AND Action=="check" ： Path="Yours is available"&lt;BR /&gt;
Path=="your/path" AND Action=="didnotcheck" ： Path="Mine is available"&lt;BR /&gt;
else ：Path=NULL&lt;/P&gt;

&lt;P&gt;Do you have field names and path match? For example,&lt;BR /&gt;
"... Mysearch | dedup Path, Action"&lt;BR /&gt;
What a result of?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 04:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276089#M83286</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2016-04-06T04:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use AND in an eval case function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276090#M83287</link>
      <description>&lt;P&gt;I would like to capture this cases in a field so that I can pipe it to stats. That's why I used case and eval &lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 04:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276090#M83287</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-06T04:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use AND in an eval case function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276091#M83288</link>
      <description>&lt;P&gt;Maybe your path contains special characters, try using match and just specifying part of your path to see if that works. If that's the case then try replacing the match with the "==" and escaping the special characters with a backslash. I would also include a default condition (1==1) in case none of the others match and also create a variable with a different name (like NewPath) to avoid overwriting your Path variable while you are still testing this and in order to see what's going on:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch 
| eval NewPath = case(
    match(Path,"my path") AND Action=="check", "Yours is available",
    match(Path,"your path") AND Action=="didnotcheck", "Mine is available" 
    1 == 1, "Others"
)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 08:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-AND-in-an-eval-case-function/m-p/276091#M83288</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-06T08:31:49Z</dc:date>
    </item>
  </channel>
</rss>

