<?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: ID of the max value event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403421#M116735</link>
    <description>&lt;P&gt;Thank you. It is another one good solution. Works correctly. My awards for you&lt;/P&gt;</description>
    <pubDate>Sat, 12 Jan 2019 07:42:31 GMT</pubDate>
    <dc:creator>kvaga</dc:creator>
    <dc:date>2019-01-12T07:42:31Z</dc:date>
    <item>
      <title>ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403415#M116729</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;
I have a table like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID, OperationName, Duration
1, oper_x, 114
2, oper_x, 117
3, oper_c, 76
4, oper_z, 87
5, oper_c, 76
6, oper_z, 128
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to show ID and OperationName which have max Duration. For example:&lt;/P&gt;

&lt;P&gt;ID, OperationName, Duration&lt;BR /&gt;
2, oper_x, 117&lt;BR /&gt;
3, oper_c, 76&lt;BR /&gt;
6, oper_z, 128&lt;/P&gt;

&lt;P&gt;Please help me. How can I do it? I tried ti use eventstat for max value searching grouped by OperationName. But can't show corresponding ID value&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403415#M116729</guid>
      <dc:creator>kvaga</dc:creator>
      <dc:date>2020-09-29T22:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403416#M116730</link>
      <description>&lt;P&gt;can you try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eventstats max(Duration) as max_opp_duration by OperationName|where max_opp_duration=Duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will give you two rows for oper_c, since ID 3 and 5 have the same duration. you could add &lt;CODE&gt;min(ID) as min_opp_id&lt;/CODE&gt; to the eventstats and then add &lt;CODE&gt;AND min_opp_id=ID&lt;/CODE&gt; to the where statement&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403416#M116730</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T22:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403417#M116731</link>
      <description>&lt;P&gt;Is this the answer?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | stats max(Duration) by ID, OperationName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 19:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403417#M116731</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-01-11T19:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403418#M116732</link>
      <description>&lt;P&gt;Thank you very much! It is exactly what I need!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:11:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403418#M116732</guid>
      <dc:creator>kvaga</dc:creator>
      <dc:date>2019-01-11T20:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403419#M116733</link>
      <description>&lt;P&gt;Unfortunately, no. Since ID is unique then you will have huge amount of pairs ID, OperationName&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403419#M116733</guid>
      <dc:creator>kvaga</dc:creator>
      <dc:date>2019-01-11T20:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403420#M116734</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="1 oper_x 114:::2 oper_x 117:::3 oper_c 76:::4 oper_z 87:::5 oper_c 76:::6 oper_z 128" 
| makemv delim=":::" raw 
| mvexpand raw 
| rename raw AS _raw 
| rex "^(?&amp;lt;ID&amp;gt;\S+)\s+(?&amp;lt;OperationName&amp;gt;\S+)\s+(?&amp;lt;Duration&amp;gt;\S+)" 

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| sort 0 - Duration 
| dedup OperationName
| sort 0 ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:35:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403420#M116734</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-11T20:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403421#M116735</link>
      <description>&lt;P&gt;Thank you. It is another one good solution. Works correctly. My awards for you&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2019 07:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403421#M116735</guid>
      <dc:creator>kvaga</dc:creator>
      <dc:date>2019-01-12T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: ID of the max value event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403422#M116736</link>
      <description>&lt;P&gt;You can only &lt;CODE&gt;Accept&lt;/CODE&gt; one but you can &lt;CODE&gt;UpVote&lt;/CODE&gt; all of them.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2019 15:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ID-of-the-max-value-event/m-p/403422#M116736</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-12T15:20:41Z</dc:date>
    </item>
  </channel>
</rss>

