<?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: Latest event filter on status in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644972#M223358</link>
    <description>&lt;P&gt;I tried this but the query is giving all the events. I want to get only the latest event.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2023 19:23:08 GMT</pubDate>
    <dc:creator>splunkuser320</dc:creator>
    <dc:date>2023-05-29T19:23:08Z</dc:date>
    <item>
      <title>Latest event filter on status- How to get the failed tasks?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644870#M223315</link>
      <description>&lt;P&gt;I have a query that is giving the latest event of the task but I want to filter the query for a status&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;base query&amp;gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| stats latest(status) as Status latest(time) as Time by TASK_NAME

&lt;/LI-CODE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;TASK_NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Time&lt;/P&gt;
&lt;P&gt;TASK 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Passed&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2023-05-19T01:32:28&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;TASK 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Failed&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;2023-05-19T01:35:28&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;TASK 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Passed&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2023-05-19T01:15:28&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;TASK 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Passed&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;2023-05-19T05:32:28&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just wants all the failed tasks&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 03:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644870#M223315</guid>
      <dc:creator>splunkuser320</dc:creator>
      <dc:date>2023-05-30T03:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Latest event filter on status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644871#M223316</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246178"&gt;@splunkuser320&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried to filer events in the main search?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base query&amp;gt;
| search status="failed"
| stats latest(status) as Status latest(time) as Time by TASK_NAME&lt;/LI-CODE&gt;&lt;P&gt;if there's the possibility that a task can have more than a status in the period, you can put the filter at the end of the search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base query&amp;gt;
| stats latest(status) as Status latest(time) as Time by TASK_NAME
| search status="failed"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 05:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644871#M223316</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-05-29T05:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Latest event filter on status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644972#M223358</link>
      <description>&lt;P&gt;I tried this but the query is giving all the events. I want to get only the latest event.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 19:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644972#M223358</guid>
      <dc:creator>splunkuser320</dc:creator>
      <dc:date>2023-05-29T19:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Latest event filter on status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644982#M223363</link>
      <description>&lt;P&gt;Just remove the group by clause then...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...&amp;lt;your query&amp;gt;...
| search Status="failed"
| stats latest(*) AS *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default, Splunk lists events with the latest first so you could even do this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...your base query... Status="failed"
| head 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 00:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Latest-event-filter-on-status-How-to-get-the-failed-tasks/m-p/644982#M223363</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-05-30T00:05:27Z</dc:date>
    </item>
  </channel>
</rss>

