<?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: How to search for latest case output in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490044#M136876</link>
    <description>&lt;P&gt;If you are correct in your redaction (a &lt;EM&gt;big&lt;/EM&gt; &lt;CODE&gt;if&lt;/CODE&gt;; we  could help better if you sent all the real &lt;CODE&gt;SPL&lt;/CODE&gt;), then the problem must be in the &lt;CODE&gt;eval&lt;/CODE&gt;.  To test, add this as the last clause in your &lt;CODE&gt;case&lt;/CODE&gt; statement: &lt;CODE&gt;true(), "DEBUG"&lt;/CODE&gt;.  You will see that &lt;CODE&gt;DEBUG&lt;/CODE&gt; is returned.  Therefore, fix your &lt;CODE&gt;case&lt;/CODE&gt;.  Also try running in &lt;CODE&gt;verbose&lt;/CODE&gt; mode because some versions of Splunk have bugs in other modes.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 21:02:36 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-09-26T21:02:36Z</dc:date>
    <item>
      <title>How to search for latest case output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490041#M136873</link>
      <description>&lt;P&gt;My search looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=name | eval request=case(X, Y, X, Y, X, Y) | stats latest(request) as Request | table Request
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Whenever I run this I am getting blank output. I really need to solve getting this to run or an alternative to providing the latest event that passed the case criteria.&lt;/P&gt;

&lt;P&gt;I have already tried doing this with nested if() statements as well instead of case, but no luck there either. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 15:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490041#M136873</guid>
      <dc:creator>rlippincott</dc:creator>
      <dc:date>2019-09-25T15:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for latest case output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490042#M136874</link>
      <description>&lt;P&gt;Have you verified the &lt;CODE&gt;eval&lt;/CODE&gt; is working as expected?  When you run &lt;CODE&gt;index=name | eval request=case(X, Y, X, Y, X, Y) | table request&lt;/CODE&gt;do you see anything in the 'request' field?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 18:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490042#M136874</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-25T18:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for latest case output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490043#M136875</link>
      <description>&lt;P&gt;I am getting nothing when doing that. My case is written like this more specifically:&lt;BR /&gt;
eval response=case(name1==good AND name2==bad, "N1 good, N2 bad", ...)&lt;BR /&gt;
I wasn't sure if using the == or = was correct, or if I could even use the AND in the parameter portion of the case function. The documentation isn't super clear and I have seen most of it used.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 14:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490043#M136875</guid>
      <dc:creator>rlippincott</dc:creator>
      <dc:date>2019-09-26T14:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for latest case output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490044#M136876</link>
      <description>&lt;P&gt;If you are correct in your redaction (a &lt;EM&gt;big&lt;/EM&gt; &lt;CODE&gt;if&lt;/CODE&gt;; we  could help better if you sent all the real &lt;CODE&gt;SPL&lt;/CODE&gt;), then the problem must be in the &lt;CODE&gt;eval&lt;/CODE&gt;.  To test, add this as the last clause in your &lt;CODE&gt;case&lt;/CODE&gt; statement: &lt;CODE&gt;true(), "DEBUG"&lt;/CODE&gt;.  You will see that &lt;CODE&gt;DEBUG&lt;/CODE&gt; is returned.  Therefore, fix your &lt;CODE&gt;case&lt;/CODE&gt;.  Also try running in &lt;CODE&gt;verbose&lt;/CODE&gt; mode because some versions of Splunk have bugs in other modes.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 21:02:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490044#M136876</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-09-26T21:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for latest case output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490045#M136877</link>
      <description>&lt;P&gt;If you get nothing in the 'request' field then there is something wrong with the &lt;CODE&gt;case&lt;/CODE&gt; statement.  Make sure all of the clauses are valid.  You can use either &lt;CODE&gt;=&lt;/CODE&gt; or &lt;CODE&gt;==&lt;/CODE&gt;.  &lt;CODE&gt;AND&lt;/CODE&gt; can be used.  Be sure to use a default clause at the end, something like &lt;CODE&gt;1==1, "oops"&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 13:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-latest-case-output/m-p/490045#M136877</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-30T13:11:06Z</dc:date>
    </item>
  </channel>
</rss>

