<?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: What are possible search strategies to find most recent values of one or more fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91742#M23677</link>
    <description>&lt;P&gt;Adding a action=fail into the search could result in a case where a user now passes and no longer fails being missed.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2012 14:44:11 GMT</pubDate>
    <dc:creator>Marinus</dc:creator>
    <dc:date>2012-10-16T14:44:11Z</dc:date>
    <item>
      <title>What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91734#M23669</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I'm looking at the possible approaches to obtain events that contain the most recent values for one or more fields.&lt;/P&gt;

&lt;P&gt;consider the following events&lt;/P&gt;

&lt;P&gt;user=a, action='pass', data=a&lt;BR /&gt;
user=b, action='fail', data=b&lt;BR /&gt;
user=c, action='pass', data=c&lt;BR /&gt;
user=c, action='fail', data=d&lt;/P&gt;

&lt;P&gt;I'd like to filter on the most recent value of let's say action.&lt;BR /&gt;
Ideally you'd like to keep the result as events so that you can &lt;BR /&gt;
report on additional fields like data.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 12:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91734#M23669</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2012-10-16T12:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91735#M23670</link>
      <description>&lt;P&gt;Could you elaborate more on what filtering behaviour you want? Is the "last" action simply the single last event, or do you mean that this should be split by user, by data, by action type etc etc...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 13:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91735#M23670</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-16T13:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91736#M23671</link>
      <description>&lt;P&gt;Ideally you'd like to end up with the last events.&lt;BR /&gt;
So I'd expect to see.&lt;/P&gt;

&lt;P&gt;user=a, action='pass', data=a&lt;BR /&gt;
user=b, action='fail', data=b&lt;BR /&gt;
user=c, action='pass', data=c&lt;/P&gt;

&lt;P&gt;you can then report with for example a table&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| table user action data&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 16 Oct 2012 13:07:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91736#M23671</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2012-10-16T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91737#M23672</link>
      <description>&lt;P&gt;Have you looked at &lt;CODE&gt;dedup&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;Considering your example above, you could try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | dedup action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will ultimately come up with two events - number 1 and 2 - since those are the events with the most recent unique values for 'action'.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | dedup data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will return the first three events, since they have unique values for 'data'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | dedup action user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will return all events since they each have a unique combination of 'user' and 'action'&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 13:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91737#M23672</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-16T13:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91738#M23673</link>
      <description>&lt;P&gt;Or more specifically all users who failed&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| where action=fail | table user action data&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 16 Oct 2012 13:13:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91738#M23673</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2012-10-16T13:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91739#M23674</link>
      <description>&lt;P&gt;Put the &lt;CODE&gt;action=fail&lt;/CODE&gt; before the first pipe. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=xxx action=fail | dedup user | table user data&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;would give you:&lt;BR /&gt;
&lt;CODE&gt;user   data&lt;BR /&gt;
b      b&lt;BR /&gt;
c      d&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;No need bring in the action, since we know it's 'fail'.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 14:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91739#M23674</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-16T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91740#M23675</link>
      <description>&lt;P&gt;The dedup strategy is a simple one. Another one is where you use stats i.e. | stats latest(action) by user. The only problem is that you don't end up with a subset and additional useful fields.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 14:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91740#M23675</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2012-10-16T14:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91741#M23676</link>
      <description>&lt;P&gt;With &lt;CODE&gt;stats&lt;/CODE&gt; you don't, with &lt;CODE&gt;dedup&lt;/CODE&gt; you do.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 14:34:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91741#M23676</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-16T14:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91742#M23677</link>
      <description>&lt;P&gt;Adding a action=fail into the search could result in a case where a user now passes and no longer fails being missed.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 14:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91742#M23677</guid>
      <dc:creator>Marinus</dc:creator>
      <dc:date>2012-10-16T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: What are possible search strategies to find most recent values of one or more fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91743#M23678</link>
      <description>&lt;P&gt;Aaah ok. didn't read between the lines.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 14:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-are-possible-search-strategies-to-find-most-recent-values/m-p/91743#M23678</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-16T14:45:37Z</dc:date>
    </item>
  </channel>
</rss>

