<?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: Can you help me with a problem with an AND operator in a CASE and IF statement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-problem-with-an-AND-operator-in-a-CASE/m-p/427304#M122333</link>
    <description>&lt;P&gt;Hi kumagaur,&lt;/P&gt;

&lt;P&gt;based on the provided examples this will work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval TeamMember="A1 A2 A3 A4 A5 A6 A7"
| makemv TeamMember 
| mvexpand TeamMember 
| eval Team = if((TeamMember="A1" OR TeamMember="A2") AND TeamMember="A4" AND TeamMember="A7", "foo" , "nope")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt;, also based on your provided information this &lt;CODE&gt;eval&lt;/CODE&gt; will never match anything because &lt;CODE&gt;TeamMember&lt;/CODE&gt; has never at the same time either &lt;CODE&gt;A1&lt;/CODE&gt; or &lt;CODE&gt;B2&lt;/CODE&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;CODE&gt;A4&lt;/CODE&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;CODE&gt;A7&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I would review either the use case or the events, because this based on the provided information will never work.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jan 2019 19:09:08 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2019-01-24T19:09:08Z</dc:date>
    <item>
      <title>Can you help me with a problem with an AND operator in a CASE and IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-problem-with-an-AND-operator-in-a-CASE/m-p/427303#M122332</link>
      <description>&lt;P&gt;I have one lookup in which there is a field which consist&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Team Member
A1
A2
A3
A4
A5
A6
A7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now,If &lt;BR /&gt;
TeamMember=(A1 OR A2) AND A4 AND A7 then print Aseries&lt;BR /&gt;
TeamMember=(A1 OR A2) and A5 AND A6 then print Bseries&lt;/P&gt;

&lt;P&gt;I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |eval Team=if((con1=="A1 OR con1=A2)"AND con1=="A4" AND con1=A7,Aseries,Other)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I used case as well but no luck.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 18:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-problem-with-an-AND-operator-in-a-CASE/m-p/427303#M122332</guid>
      <dc:creator>kumagaur</dc:creator>
      <dc:date>2019-01-24T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a problem with an AND operator in a CASE and IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-problem-with-an-AND-operator-in-a-CASE/m-p/427304#M122333</link>
      <description>&lt;P&gt;Hi kumagaur,&lt;/P&gt;

&lt;P&gt;based on the provided examples this will work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval TeamMember="A1 A2 A3 A4 A5 A6 A7"
| makemv TeamMember 
| mvexpand TeamMember 
| eval Team = if((TeamMember="A1" OR TeamMember="A2") AND TeamMember="A4" AND TeamMember="A7", "foo" , "nope")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt;, also based on your provided information this &lt;CODE&gt;eval&lt;/CODE&gt; will never match anything because &lt;CODE&gt;TeamMember&lt;/CODE&gt; has never at the same time either &lt;CODE&gt;A1&lt;/CODE&gt; or &lt;CODE&gt;B2&lt;/CODE&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;CODE&gt;A4&lt;/CODE&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; &lt;CODE&gt;A7&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I would review either the use case or the events, because this based on the provided information will never work.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 19:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-problem-with-an-AND-operator-in-a-CASE/m-p/427304#M122333</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-01-24T19:09:08Z</dc:date>
    </item>
  </channel>
</rss>

