<?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: help me with search command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288123#M87227</link>
    <description>&lt;P&gt;@sravankaripe... You would actually need to provide details around what is your conditions and what is the event when the condition will be triggered.&lt;/P&gt;

&lt;P&gt;Please see a example below where I am running a dummy search to set my token. Then I am using the token in the actual search as search query filter. There are multiple possibilities and solutions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
| eval log_level="INFO"
| table testData&amp;lt;/query&amp;gt;
  &amp;lt;preview&amp;gt;
    &amp;lt;eval token="queryString"&amp;gt;if(log_level=="INFO","INFO","ERROR")&amp;lt;/eval&amp;gt;
  &amp;lt;/preview&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype="splunkd" log_level="$queryString$"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;          
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Mar 2017 20:52:13 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-03-24T20:52:13Z</dc:date>
    <item>
      <title>help me with search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288121#M87225</link>
      <description>&lt;P&gt;-------| eval test=if(condition,"INFO","Error") | search test&lt;/P&gt;

&lt;P&gt;if condition is true the search must be behave as&lt;BR /&gt;
--------| search "INFO"&lt;/P&gt;

&lt;P&gt;else&lt;BR /&gt;
--------| search "Error"&lt;/P&gt;

&lt;P&gt;please help me with this&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288121#M87225</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2017-03-24T20:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: help me with search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288122#M87226</link>
      <description>&lt;P&gt;use tokens&lt;/P&gt;

&lt;P&gt;-------| eval test=if(condition,"INFO","Error") | search $test$&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288122#M87226</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-03-24T20:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: help me with search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288123#M87227</link>
      <description>&lt;P&gt;@sravankaripe... You would actually need to provide details around what is your conditions and what is the event when the condition will be triggered.&lt;/P&gt;

&lt;P&gt;Please see a example below where I am running a dummy search to set my token. Then I am using the token in the actual search as search query filter. There are multiple possibilities and solutions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
| eval log_level="INFO"
| table testData&amp;lt;/query&amp;gt;
  &amp;lt;preview&amp;gt;
    &amp;lt;eval token="queryString"&amp;gt;if(log_level=="INFO","INFO","ERROR")&amp;lt;/eval&amp;gt;
  &amp;lt;/preview&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype="splunkd" log_level="$queryString$"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;          
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288123#M87227</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-24T20:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: help me with search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288124#M87228</link>
      <description>&lt;P&gt;Like this (with a subsearch):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search [|noop | stats count AS search | eval search=if(condition, "INFO, "Error") | return $search]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-me-with-search-command/m-p/288124#M87228</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-24T20:54:25Z</dc:date>
    </item>
  </channel>
</rss>

