<?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 query events where the latest event field is only a specific value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549200#M155810</link>
    <description>&lt;P&gt;Thank you, that works...&lt;/P&gt;&lt;P&gt;I want to look historically over 24 hours or 7 days,&amp;nbsp; so I tried to bin _time span=1h&amp;nbsp; and it didn't work...&lt;/P&gt;&lt;P&gt;Any ideas how to apply historic searches to that...&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example running the following over 24hours...&amp;nbsp; I know its faulty depending on when the time break is but that is good enough...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo outcome=* user=*
| bin _time span=5m   
| stats latest(_time) latest(outcome) by user
| rename latest(*)= *
| where outcome="fail"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words, I want to check 5 minute intervals for the lastest outcome as a fail.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 22:36:09 GMT</pubDate>
    <dc:creator>Glasses</dc:creator>
    <dc:date>2021-04-23T22:36:09Z</dc:date>
    <item>
      <title>How to query events where the latest event field is only a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549192#M155804</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a request to find all users that have outcome=fail as the latest event. The outcome can be fail or success&lt;/P&gt;&lt;P&gt;for example &amp;gt;&amp;gt;&amp;gt; index=foo |stats latest(outcome) by user _time&lt;/P&gt;&lt;P&gt;Joe fail 2021-04-23 19:57:25.998&lt;BR /&gt;Joe success 2021-04-23 19:40:05.888&lt;/P&gt;&lt;P&gt;Trying to write a query where the result is only users with a fail as last outcome, not success as last outcome.&lt;BR /&gt;Any advice appreciated, TY!!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549192#M155804</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2021-04-23T21:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to query events where the latest event field is only a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549194#M155806</link>
      <description>&lt;P&gt;So, you're looking for outcome events by user, so your by clause of your stats should reflect that... (no need for by _time as well)... Then you can use a where or search command to limit the output of your stats command, like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo outcome=* user=*
| stats latest(_time) latest(outcome) by user
| rename latest(*) -&amp;gt; *
| where outcome="fail"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549194#M155806</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2021-04-23T21:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to query events where the latest event field is only a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549200#M155810</link>
      <description>&lt;P&gt;Thank you, that works...&lt;/P&gt;&lt;P&gt;I want to look historically over 24 hours or 7 days,&amp;nbsp; so I tried to bin _time span=1h&amp;nbsp; and it didn't work...&lt;/P&gt;&lt;P&gt;Any ideas how to apply historic searches to that...&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example running the following over 24hours...&amp;nbsp; I know its faulty depending on when the time break is but that is good enough...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo outcome=* user=*
| bin _time span=5m   
| stats latest(_time) latest(outcome) by user
| rename latest(*)= *
| where outcome="fail"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words, I want to check 5 minute intervals for the lastest outcome as a fail.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 22:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-events-where-the-latest-event-field-is-only-a/m-p/549200#M155810</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2021-04-23T22:36:09Z</dc:date>
    </item>
  </channel>
</rss>

