<?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 build a search using 4 different ad hoc searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320697#M95828</link>
    <description>&lt;P&gt;This part &lt;CODE&gt;(cli_attr=="MOBILE_IND=Y") OR (cli_attr!="MOBILE_IND==Y")&lt;/CODE&gt; makes no sense (it's always true), you may as well leave it out and just use PatnerCode&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2017 18:30:37 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2017-09-07T18:30:37Z</dc:date>
    <item>
      <title>How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320694#M95825</link>
      <description>&lt;P&gt;base-search earliest=-1h@m|&lt;BR /&gt;
Desk &lt;BR /&gt;
cli_attr="MOBILE_IND=N"&lt;/P&gt;

&lt;P&gt;Mobile &lt;BR /&gt;
cli_attr="MOBILE_IND=Y" &lt;/P&gt;

&lt;P&gt;Emarketing&lt;BR /&gt;
cli_attr="MOBILE_IND=Y"  OR cli_attr="MOBILE_IND=N" PartnerCode=*&lt;/P&gt;

&lt;P&gt;Non-Emarketing &lt;BR /&gt;
cli_attr="MOBILE_IND=Y"  OR cli_attr="MOBILE_IND=N" NOT PartnerCode=*&lt;/P&gt;

&lt;P&gt;using these am trying to build a base search &lt;/P&gt;

&lt;P&gt;|eval deskdev=if(cli_attr=="MOBILE_IND=N","MOBILE_IND=N",NULL)&lt;BR /&gt;
|eval mobiledev=if(cli_attr!="MOBILE_IND=N","MOBILE_IND=N",NULL) &lt;BR /&gt;
|eval eMarketing=if((cli_attr=="MOBILE_IND=Y") OR (cli_attr!="MOBILE_IND==Y") AND  (PartnerCode=="&lt;EM&gt;") , "MOBILE_IND=Y",NULL) &lt;BR /&gt;
|eval NoneMarketing=if((cli_attr=="MOBILE_IND=Y") OR (cli_attr!="MOBILE_IND=Y") AND  (PartnerCode!="&lt;/EM&gt;"),"MOBILE_IND=Y",NULL)&lt;/P&gt;

&lt;P&gt;search not able to match the values with original, how would it possible. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320694#M95825</guid>
      <dc:creator>svemurilv</dc:creator>
      <dc:date>2020-09-29T15:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320695#M95826</link>
      <description>&lt;P&gt;This should work. I recommend using &lt;CODE&gt;null()&lt;/CODE&gt; instead of NULL, but that's not your issue.&lt;BR /&gt;
Can you provide a sample event? Are you sure your field contents in the events are present and have the &lt;STRONG&gt;exact value&lt;/STRONG&gt; you are looking for?&lt;/P&gt;

&lt;P&gt;This run-anywhere search validates that your query is correct: &lt;CODE&gt;| makeresults | eval cli_attr="MOBILE_IND=N" | eval deskdev=if(cli_attr=="MOBILE_IND=N","MOBILE_IND=N",null())&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 17:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320695#M95826</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-09-07T17:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320696#M95827</link>
      <description>&lt;P&gt;Am good with the Desktop and Mobile , but am not sure how to write the &lt;CODE&gt;|eval&lt;/CODE&gt; condition for Emarketing and NonEmarketing. where i struck &lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 18:23:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320696#M95827</guid>
      <dc:creator>svemurilv</dc:creator>
      <dc:date>2017-09-07T18:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320697#M95828</link>
      <description>&lt;P&gt;This part &lt;CODE&gt;(cli_attr=="MOBILE_IND=Y") OR (cli_attr!="MOBILE_IND==Y")&lt;/CODE&gt; makes no sense (it's always true), you may as well leave it out and just use PatnerCode&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 18:30:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320697#M95828</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-09-07T18:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320698#M95829</link>
      <description>&lt;P&gt;missing these ?&lt;/P&gt;

&lt;P&gt;Emarketing&lt;BR /&gt;
cli_attr="MOBILE_IND=Y" OR cli_attr="MOBILE_IND=N" &lt;CODE&gt;PartnerCode=*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Non-Emarketing &lt;BR /&gt;
cli_attr="MOBILE_IND=Y" OR cli_attr="MOBILE_IND=N" &lt;CODE&gt;NOT PartnerCode=*&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320698#M95829</guid>
      <dc:creator>svemurilv</dc:creator>
      <dc:date>2020-09-29T15:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320699#M95830</link>
      <description>&lt;P&gt;What values can cli_attr have other than MOBILE_IND=Y and MOBILE_IND=N?&lt;/P&gt;

&lt;P&gt;Maybe we can help better if you verbally describe the conditions you want to test for and the resulting values for the eval'ed target field, as I am not clear on what you want your outcome to be.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320699#M95830</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2020-09-29T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320700#M95831</link>
      <description>&lt;P&gt;here in the the search we have included a  PartnerCode=* and   NOT PartnerCode=* there 2 are the differences between emarketing and nonemarketing  we should include that part also in the same |eval If condition  for each &lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 19:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320700#M95831</guid>
      <dc:creator>svemurilv</dc:creator>
      <dc:date>2017-09-07T19:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a search using 4 different ad hoc searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320701#M95832</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base-search earliest=-1h@m
| stats count(eval(searchmatch("cli_attr=\"MOBILE_IND=N\""))) AS deskdev
        count(eval(searchmatch("cli_attr=\"MOBILE_IND=Y\""))) AS mobiledev
        count(eval(searchmatch("cli_attr=\"MOBILE_IND=Y\" OR cli_attr=\"MOBILE_IND=N\" PartnerCode=\"*\""))) AS eMarketing
        count(eval(searchmatch("cli_attr=\"MOBILE_IND=Y\" OR cli_attr=\"MOBILE_IND=N\" NOT PartnerCode=\"*\""))) AS NoneMarketing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is hilarious but probably won't fly for you to call &lt;CODE&gt;Non-eMarketing&lt;/CODE&gt; by &lt;CODE&gt;None Marketing&lt;/CODE&gt;, kind of like a psychologist using &lt;CODE&gt;therpaist.com&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 04:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-search-using-4-different-ad-hoc-searches/m-p/320701#M95832</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-08T04:56:55Z</dc:date>
    </item>
  </channel>
</rss>

