<?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 search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484241#M135536</link>
    <description>&lt;P&gt;If it works for you please accept the answer to close this question.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 14:33:52 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2019-11-13T14:33:52Z</dc:date>
    <item>
      <title>Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484236#M135531</link>
      <description>&lt;P&gt;Below is the log example.&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: &lt;STRONG&gt;History was not closed with a proper agent termination after the above date.&lt;/STRONG&gt;&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: Repairing of history database started...&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: NumRead 48 NumWritten 48&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: Successfully fixed parameter history database.&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: NumRead 48 NumWritten 48&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: Successfully fixed annotation database.&lt;BR /&gt;
Fri Oct 11 20:01:48 2019: &lt;STRONG&gt;Repairing of history database was completed successfully&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The first and last lines were the 2 strings that I was looking for in the log. &lt;/P&gt;

&lt;P&gt;I wanted to create a search to return a list of servers' name where only string 1 is found and string2 is NOT. Because it's parsed as a separate event for each timestamp, simple "search1 NOT search2" doesn't work.  I tried subsearch like search string 1 NOT [search string 2] and it still didn't work as what I expected. Any idea? Thanks.&lt;/P&gt;

&lt;P&gt;Zhang&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 19:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484236#M135531</guid>
      <dc:creator>zzhao05</dc:creator>
      <dc:date>2019-11-12T19:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484237#M135532</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; |  eval field=case(like(_raw,"%History was not closed with a proper agent termination after the above date%"),"value1",like(_raw,"%Repairing of history database was completed successfully%"),"value2") 
|  stats dc(field) as dc_field values(field) as field by server 
| where dc_field="1" AND field=value1 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Nov 2019 20:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484237#M135532</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-12T20:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484238#M135533</link>
      <description>&lt;P&gt;Attached is the snapshot.. It's not what I was looking for..  I need a list of server names..&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 21:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484238#M135533</guid>
      <dc:creator>zzhao05</dc:creator>
      <dc:date>2019-11-12T21:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484239#M135534</link>
      <description>&lt;P&gt;yeah, so that's what you are getting. add &lt;CODE&gt;|table server&lt;/CODE&gt; at the end. I am assuming that all the servers are stored in a field. if not then you would have to extract it. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 21:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484239#M135534</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-12T21:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484240#M135535</link>
      <description>&lt;P&gt;Cool... Thank you very much!! It worked.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 22:33:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484240#M135535</guid>
      <dc:creator>zzhao05</dc:creator>
      <dc:date>2019-11-12T22:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484241#M135536</link>
      <description>&lt;P&gt;If it works for you please accept the answer to close this question.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 14:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-search/m-p/484241#M135536</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-13T14:33:52Z</dc:date>
    </item>
  </channel>
</rss>

