<?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: Search in eval if in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305706#M91764</link>
    <description>&lt;P&gt;That doesn't work for me. in the base search it's like if Module=$field2$. So if the module matches some value x, I want to search something and display a chart. Otherwise I want to  search something else and display a different chart.&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2017 12:38:22 GMT</pubDate>
    <dc:creator>pranaynanda</dc:creator>
    <dc:date>2017-05-31T12:38:22Z</dc:date>
    <item>
      <title>Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305698#M91756</link>
      <description>&lt;P&gt;I want to do something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search | eval Mod=if(Module=Excel OR Module=Word, [search extension=xls OR extension=xslx OR extension=doc OR extension=docx|stats count by extension],"It is not an MS Office document")...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I always keep running into an error that says the search encountered an unexpected character. Please help.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 08:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305698#M91756</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-22T08:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305699#M91757</link>
      <description>&lt;P&gt;Can you explain what is the output you are expecting?&lt;/P&gt;

&lt;P&gt;Mod is variable and the if condition if first case returns a table and not a single value, and in second case is set with a text message.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 09:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305699#M91757</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-22T09:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305700#M91758</link>
      <description>&lt;P&gt;I basically want to search different if the condition matches or fails.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 09:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305700#M91758</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-22T09:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305701#M91759</link>
      <description>&lt;P&gt;You will have to give more details of what you are trying to do in else condition and what is the query you might run.&lt;/P&gt;

&lt;P&gt;Also sample mock fields for Office and Not-office documents.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 15:50:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305701#M91759</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-22T15:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305702#M91760</link>
      <description>&lt;P&gt;Try something like...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search 
| eval myExt=if(extension="xls" OR extension="xlsx" OR extension="doc" OR extension="docx",extension,"Not MS Office")
| stats count by myExt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 17:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305702#M91760</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-22T17:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305703#M91761</link>
      <description>&lt;P&gt;Basically, If the condition happens to be true, I want it to search by extension and return with stats. Otherwise, in the else part, I wish to run a regex.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 03:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305703#M91761</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-24T03:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305704#M91762</link>
      <description>&lt;P&gt;Well basically, in the base search it's something like Module=$field2$ that is guided by a drop down box. I wish to check if the module is A or if module is B then run this search otherwise run a regex.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 03:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305704#M91762</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-24T03:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305705#M91763</link>
      <description>&lt;P&gt;would something like this be valid?&lt;/P&gt;

&lt;P&gt;... Module=Excel| eval Modx=if(Module="Excel" , "extension=xls OR extension=xlsx","extension=doc OR extension=docx") | search Modx&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 05:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305705#M91763</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-24T05:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305706#M91764</link>
      <description>&lt;P&gt;That doesn't work for me. in the base search it's like if Module=$field2$. So if the module matches some value x, I want to search something and display a chart. Otherwise I want to  search something else and display a different chart.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 12:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305706#M91764</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-05-31T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305707#M91765</link>
      <description>&lt;P&gt;Hi there, please try addin single quotes &lt;CODE&gt;'&lt;/CODE&gt; before and after the brackets, like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search | eval Mod=if(Module=Excel OR Module=Word, '[search extension=xls OR extension=xslx OR extension=doc OR extension=docx|stats count by extension]',"It is not an MS Office document")...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 13:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305707#M91765</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2017-05-31T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305708#M91766</link>
      <description>&lt;P&gt;How will I get the output out of it? How will I get results of Mod?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 08:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305708#M91766</guid>
      <dc:creator>pranaynanda</dc:creator>
      <dc:date>2017-06-01T08:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Search in eval if</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305709#M91767</link>
      <description>&lt;P&gt;where you able to solve this issue?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 15:44:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-in-eval-if/m-p/305709#M91767</guid>
      <dc:creator>dhivyamu</dc:creator>
      <dc:date>2019-11-08T15:44:56Z</dc:date>
    </item>
  </channel>
</rss>

