<?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 Include literal dataset in search query / Ensure fixed number of rows in result set in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685665#M233953</link>
    <description>&lt;P&gt;Anyone know how to accomplish the Splunk equivalent of the following SQL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;SELECT * FROM (SELECT 'dev' AS env, 0 as value UNION SELECT 'beta' as env, 0 as value UNION SELECT 'prod' as env, 0 as value)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I intend to combine this arbitrary, literal dataset with another query, but I want to ensure that there are rows for 'dev', 'beta', and 'prod' whether or not Splunk is able to find any records for these environments. The reason for this is, I'm trying to create an alert that will trigger if a particular metric is NOT published often enough in Splunk for each of these environments.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2024 17:25:38 GMT</pubDate>
    <dc:creator>trevorreed</dc:creator>
    <dc:date>2024-04-26T17:25:38Z</dc:date>
    <item>
      <title>Include literal dataset in search query / Ensure fixed number of rows in result set</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685665#M233953</link>
      <description>&lt;P&gt;Anyone know how to accomplish the Splunk equivalent of the following SQL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;SELECT * FROM (SELECT 'dev' AS env, 0 as value UNION SELECT 'beta' as env, 0 as value UNION SELECT 'prod' as env, 0 as value)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I intend to combine this arbitrary, literal dataset with another query, but I want to ensure that there are rows for 'dev', 'beta', and 'prod' whether or not Splunk is able to find any records for these environments. The reason for this is, I'm trying to create an alert that will trigger if a particular metric is NOT published often enough in Splunk for each of these environments.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 17:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685665#M233953</guid>
      <dc:creator>trevorreed</dc:creator>
      <dc:date>2024-04-26T17:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Include literal dataset in search query / Ensure fixed number of rows in result set</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685668#M233955</link>
      <description>&lt;P&gt;Finding something that is not there is not Splunk's strong suit.&amp;nbsp; See this blog entry for a good write-up on it.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.duanewaddle.com/proving-a-negative/" target="_blank"&gt;https://www.duanewaddle.com/proving-a-negative/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One way to produce the equivalent to that SQL is with makeresults.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;&amp;lt;your search for env (dev,beta, or prod) and count&amp;gt;&amp;gt;
| append [| makeresults format=csv data="env,count
dev,0
beta,0
prod,0"]
| stats sum(count) as count by env&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 26 Apr 2024 17:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685668#M233955</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-26T17:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Include literal dataset in search query / Ensure fixed number of rows in result set</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685670#M233956</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#993300"&gt;makeresults&lt;/FONT&gt;&lt;/STRONG&gt; command is exactly what I needed. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 17:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-literal-dataset-in-search-query-Ensure-fixed-number-of/m-p/685670#M233956</guid>
      <dc:creator>trevorreed</dc:creator>
      <dc:date>2024-04-26T17:53:37Z</dc:date>
    </item>
  </channel>
</rss>

