<?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 Append search term based on condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Append-search-term-based-on-condition/m-p/155600#M43786</link>
    <description>&lt;P&gt;How can I append a search term based on a condition?&lt;/P&gt;

&lt;P&gt;For example - &lt;/P&gt;

&lt;PRE&gt;if fieldA &amp;gt; 1 &lt;/PRE&gt;I want to append &lt;PRE&gt;| search someCriteriaA&lt;/PRE&gt; else I want to append &lt;PRE&gt;| search someOtherCriteriaB&lt;/PRE&gt;

&lt;P&gt;Here fieldA is output of eventstats.. hence the value of the fieldA would be same across the events&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2014 02:33:02 GMT</pubDate>
    <dc:creator>pradeepkumarg</dc:creator>
    <dc:date>2014-07-24T02:33:02Z</dc:date>
    <item>
      <title>Append search term based on condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-search-term-based-on-condition/m-p/155600#M43786</link>
      <description>&lt;P&gt;How can I append a search term based on a condition?&lt;/P&gt;

&lt;P&gt;For example - &lt;/P&gt;

&lt;PRE&gt;if fieldA &amp;gt; 1 &lt;/PRE&gt;I want to append &lt;PRE&gt;| search someCriteriaA&lt;/PRE&gt; else I want to append &lt;PRE&gt;| search someOtherCriteriaB&lt;/PRE&gt;

&lt;P&gt;Here fieldA is output of eventstats.. hence the value of the fieldA would be same across the events&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 02:33:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-search-term-based-on-condition/m-p/155600#M43786</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-07-24T02:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Append search term based on condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-search-term-based-on-condition/m-p/155601#M43787</link>
      <description>&lt;P&gt;Why not this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourbasesearch (fieldA &amp;gt; 1 AND someCriteriaA) OR (fieldA &amp;lt;= 1 AND someOtherCriteriaB)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Oops - just saw the &lt;CODE&gt;eventstats&lt;/CODE&gt; comment. Then do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourbasesearch
| eventstats something to get fieldA
| search (fieldA &amp;gt; 1 AND someCriteriaA) OR (fieldA &amp;lt;= 1 AND someOtherCriteriaB)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Jul 2014 06:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-search-term-based-on-condition/m-p/155601#M43787</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-07-24T06:02:57Z</dc:date>
    </item>
  </channel>
</rss>

