<?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: Conditional searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67741#M16920</link>
    <description>&lt;P&gt;Just don't use source as a field to run &lt;CODE&gt;transaction&lt;/CODE&gt; on.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2012 12:13:37 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-10-11T12:13:37Z</dc:date>
    <item>
      <title>Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67735#M16914</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
We have gotten quite a complex search request, which we are not sure if is possible at all.&lt;/P&gt;

&lt;P&gt;If the application log says "SITE X DOWN", and then within an five minute interval logs "SITE BACKUP X DOWN" it must raise an alert. If the applications logs SITE BAKCUP X DOWN outside the five minute interval everything is OK.&lt;/P&gt;

&lt;P&gt;How, if at all possible, could this be accomplished?&lt;/P&gt;

&lt;P&gt;--&lt;BR /&gt;
Espen&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2011 07:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67735#M16914</guid>
      <dc:creator>efo</dc:creator>
      <dc:date>2011-08-31T07:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67736#M16915</link>
      <description>&lt;P&gt;You can use the &lt;CODE&gt;transaction&lt;/CODE&gt; command. This will join separate events together to a new combined event (a transaction) based on rules that you specify. You can then search for transactions that match multiple conditions.&lt;/P&gt;

&lt;P&gt;In your case, you want to find cases where "SITE X DOWN" and "SITE BACKUP X DOWN" occur within a 5 minute interval. This can be accomplished using &lt;CODE&gt;transaction&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"SITE X DOWN" OR "SITE BACKUP X DOWN" 
| transaction source startswith="SITE X DOWN" endswith="SITE BACKUP X DOWN" maxspan=5m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any events returned by this search will match your condition. I used "source" as an argument to &lt;CODE&gt;transaction&lt;/CODE&gt; but any field identifier can be used. This specifies what field(s) Splunk should look for and use when grouping together events, so in this case Splunk will be looking to grouping events into transactions if they have the same value for the "source" field. The more unique the field value, the better.&lt;/P&gt;

&lt;P&gt;More information on the &lt;CODE&gt;transaction&lt;/CODE&gt; command is available in the docs: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2011 08:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67736#M16915</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-08-31T08:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67737#M16916</link>
      <description>&lt;P&gt;Excellent answer, clearly explained&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2011 08:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67737#M16916</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-08-31T08:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67738#M16917</link>
      <description>&lt;P&gt;This solves the problem.&lt;BR /&gt;
Thank you very much, Ayn&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2011 06:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67738#M16917</guid>
      <dc:creator>efo</dc:creator>
      <dc:date>2011-09-15T06:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67739#M16918</link>
      <description>&lt;P&gt;This is perfect, thank you.&lt;BR /&gt;
But is it best run with time range "rt-5 to rt" or just a normal search that ranges the last ten minutes or so?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2011 07:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67739#M16918</guid>
      <dc:creator>efo</dc:creator>
      <dc:date>2011-09-15T07:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67740#M16919</link>
      <description>&lt;P&gt;How would you do it if you have two different source logs?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67740#M16919</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2012-10-11T12:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67741#M16920</link>
      <description>&lt;P&gt;Just don't use source as a field to run &lt;CODE&gt;transaction&lt;/CODE&gt; on.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-searches/m-p/67741#M16920</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-11T12:13:37Z</dc:date>
    </item>
  </channel>
</rss>

