<?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: Updating maximum value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528426#M149212</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults count=20
| eval time=random() % 20 + 1
| eval _time=relative_time(_time,"+".time."d@d-1mon")
| bin _time span=1d
| sort _time
| eval data=random() % 30
| table _time data
| rename COMMENT as "this is sample data, check this. from here, the logic"
| eval date_day=strftime(_time,"%d")
| eventstats max(data) as maximum by date_day
| eval check=if(data==maximum,"yes","no")&lt;/LI-CODE&gt;&lt;P&gt;Not much has changed, though.&lt;BR /&gt;You can use eventstats for dates.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Nov 2020 08:41:32 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-11-08T08:41:32Z</dc:date>
    <item>
      <title>Updating maximum value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528407#M149199</link>
      <description>&lt;P&gt;I have a data set with values in a specific moment in time. Each day can have multiple values (but in different events). I want to find the events that have the highest value in that moment in time. For example, if the data is the following:&lt;/P&gt;&lt;P&gt;Day1, 10&lt;BR /&gt;Day2, 13&lt;BR /&gt;Day2, 12&lt;BR /&gt;Day3, 11&lt;BR /&gt;Day3, 14&lt;BR /&gt;Day 4, 12&lt;BR /&gt;Day 5, 15&lt;/P&gt;&lt;P&gt;The search should return that Day1, Day2 (the first row), Day3 (the second row) and Day5 had the highest numbers at the moment they occurred. I do not only want the final highest value but the maximum at that moment in time (like the events after it didn't happen). For example, an additional column can be added which indicates whether it is/was the highest result.&lt;BR /&gt;&lt;BR /&gt;Day1, 10, Yes&lt;BR /&gt;Day2, 13, Yes&lt;BR /&gt;Day2, 12, No&lt;BR /&gt;Day3, 11, No&lt;BR /&gt;Day3, 14, Yes&lt;BR /&gt;Day 4, 12, No&lt;BR /&gt;Day 5, 15, Yes&lt;BR /&gt;&lt;BR /&gt;I have been trying to achieve this with the MAX function but I couldn't get it working. Is it possible to achieve this?&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 19:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528407#M149199</guid>
      <dc:creator>michaelbosch</dc:creator>
      <dc:date>2020-11-07T19:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Updating maximum value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528421#M149207</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190804"&gt;@michaelbosch&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the streamstats command is the solution for your need, see this example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| dedup date_hour timeendpos
| table date_hour timeendpos
| streamstats max(timeendpos) AS max BY date_hour
| eval check=if(timeendpos=max,"Yes","Not")&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 06:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528421#M149207</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-08T06:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Updating maximum value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528426#M149212</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults count=20
| eval time=random() % 20 + 1
| eval _time=relative_time(_time,"+".time."d@d-1mon")
| bin _time span=1d
| sort _time
| eval data=random() % 30
| table _time data
| rename COMMENT as "this is sample data, check this. from here, the logic"
| eval date_day=strftime(_time,"%d")
| eventstats max(data) as maximum by date_day
| eval check=if(data==maximum,"yes","no")&lt;/LI-CODE&gt;&lt;P&gt;Not much has changed, though.&lt;BR /&gt;You can use eventstats for dates.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 08:41:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528426#M149212</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-11-08T08:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Updating maximum value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528430#M149216</link>
      <description>&lt;P&gt;Thank you for your reply. The results can have different timestamps. Using&amp;nbsp;&lt;EM&gt;| streamstats max(timeendpos) AS max BY date_hour&lt;/EM&gt;,&amp;nbsp;the maximum will be found by &lt;EM&gt;date_hour&lt;/EM&gt;, right? I now use another column to group by and it seems to work now!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 10:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528430#M149216</guid>
      <dc:creator>michaelbosch</dc:creator>
      <dc:date>2020-11-08T10:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Updating maximum value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528431#M149217</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190804"&gt;@michaelbosch&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it was a sample to explain to you how to approach the problem!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 10:30:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Updating-maximum-value/m-p/528431#M149217</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-08T10:30:37Z</dc:date>
    </item>
  </channel>
</rss>

