<?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: Return something when search doesn't return anything in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24799#M4613</link>
    <description>&lt;P&gt;My own comment of 'set math' set me on a path to the "set union" command. I now search for successes and failures and combine to a single table.&lt;/P&gt;

&lt;P&gt;I have not answered my original question, but I have a work around for my current problem.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2011 18:51:27 GMT</pubDate>
    <dc:creator>jordans</dc:creator>
    <dc:date>2011-11-30T18:51:27Z</dc:date>
    <item>
      <title>Return something when search doesn't return anything</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24796#M4610</link>
      <description>&lt;P&gt;I want to have a table with results of a search of the SQL logs for backups. But the search I have only returns the successful backups. I want to display a line in the table if a backup failed, i.e. if a database name does NOT appear in the search results. &lt;/P&gt;

&lt;P&gt;Is this possible? I tried an 'append', but the last line is repeated if the search term is not found.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2011 23:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24796#M4610</guid>
      <dc:creator>jordans</dc:creator>
      <dc:date>2011-11-29T23:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Return something when search doesn't return anything</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24797#M4611</link>
      <description>&lt;P&gt;Do you have (or can generate) a list of all Database Names? &lt;BR /&gt;
You could index that list.&lt;BR /&gt;
Extract the database name from the backup logs.  Use the same fieldname (e.g., db_name) in both sourcetypes (the list of all databases and the backup log)&lt;/P&gt;

&lt;P&gt;The following should give you a list of database names from the alldatabases sourcetype that aren't matched in the backuplog sourcetype.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="alldatabases" | join type=outer db_name [search sourcetype=backuplog] | search sourcetype=alldatabases | table db_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2011 16:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24797#M4611</guid>
      <dc:creator>eelisio2</dc:creator>
      <dc:date>2011-11-30T16:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Return something when search doesn't return anything</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24798#M4612</link>
      <description>&lt;P&gt;I don't think the set math works. I get a list of all databases from the database list. &lt;/P&gt;

&lt;P&gt;To test, I added a bogus database name to a txt file of valid db names, indexed it, and performed your search.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 18:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24798#M4612</guid>
      <dc:creator>jordans</dc:creator>
      <dc:date>2011-11-30T18:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return something when search doesn't return anything</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24799#M4613</link>
      <description>&lt;P&gt;My own comment of 'set math' set me on a path to the "set union" command. I now search for successes and failures and combine to a single table.&lt;/P&gt;

&lt;P&gt;I have not answered my original question, but I have a work around for my current problem.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 18:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24799#M4613</guid>
      <dc:creator>jordans</dc:creator>
      <dc:date>2011-11-30T18:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Return something when search doesn't return anything</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24800#M4614</link>
      <description>&lt;P&gt;I'm glad that you found a different solution.  The search from my answer will work as well. There needs to be a common field name for the join command to work. &lt;/P&gt;

&lt;P&gt;Note that if you run my search without " | search sourcetype=alldatabases | table db_name", the result set has a mix of the 2 sourcetypes.  The rows with the sourcetype="alldatabases" did not find a match in the other sourcetype. So, the extra search command at the end should filter the results accordingly.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 19:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-something-when-search-doesn-t-return-anything/m-p/24800#M4614</guid>
      <dc:creator>eelisio2</dc:creator>
      <dc:date>2011-11-30T19:27:21Z</dc:date>
    </item>
  </channel>
</rss>

