<?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: group by from fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415577#M119619</link>
    <description>&lt;P&gt;Maybe I didn't express myself well. I need to group display all latest events by date by technology. And sometimes I have more than one event with the same date and same technology.&lt;/P&gt;

&lt;P&gt;Thanks for the max tip.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jul 2019 13:18:56 GMT</pubDate>
    <dc:creator>andreyglauzer</dc:creator>
    <dc:date>2019-07-28T13:18:56Z</dc:date>
    <item>
      <title>group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415573#M119615</link>
      <description>&lt;P&gt;I have events similar to these:&lt;/P&gt;

&lt;P&gt;component, technology, mydate&lt;BR /&gt;
silva, java, 06/20/2019&lt;BR /&gt;
souza, java, 06/20/2019&lt;BR /&gt;
silva, java, 07/20/2019&lt;BR /&gt;
silva, python, 12/07/2019&lt;BR /&gt;
uol, python, 09/07/2019&lt;/P&gt;

&lt;P&gt;I would like to group the events by the technology field, taking all the events that have the largest date. But I can only bring up an event when I try to bring in the latest date using the search:&lt;BR /&gt;
index = "you" | stats max (mydate) as best by technology&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 17:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415573#M119615</guid>
      <dc:creator>andreyglauzer</dc:creator>
      <dc:date>2019-07-27T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415574#M119616</link>
      <description>&lt;P&gt;The &lt;CODE&gt;max&lt;/CODE&gt; function needs a numeric argument, not the strings in the mydate field.  Convert the dates into epochs and you should have your results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = "you" | eval epoch=strptime(mydate, "%m/%d/%Y") 
| stats max(epoch) as best by technology 
| eval best = strftime(epoch, "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Jul 2019 02:59:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415574#M119616</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-28T02:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415575#M119617</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|dedup technology sortby -mydate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Jul 2019 03:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415575#M119617</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-07-28T03:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415576#M119618</link>
      <description>&lt;P&gt;Add this before your &lt;CODE&gt;stats&lt;/CODE&gt; line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval mydate = strptime(mydate, "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then add this to the end:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval fieldformat mydate = strftime(mydate, "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Jul 2019 12:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415576#M119618</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-28T12:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415577#M119619</link>
      <description>&lt;P&gt;Maybe I didn't express myself well. I need to group display all latest events by date by technology. And sometimes I have more than one event with the same date and same technology.&lt;/P&gt;

&lt;P&gt;Thanks for the max tip.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 13:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415577#M119619</guid>
      <dc:creator>andreyglauzer</dc:creator>
      <dc:date>2019-07-28T13:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415578#M119620</link>
      <description>&lt;P&gt;Maybe I didn't express myself well. I need to group display all latest events by date by technology. And sometimes I have more than one event with the same date and same technology.&lt;/P&gt;

&lt;P&gt;This works better, thanks for the tip.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 13:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415578#M119620</guid>
      <dc:creator>andreyglauzer</dc:creator>
      <dc:date>2019-07-28T13:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: group by from fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415579#M119621</link>
      <description>&lt;P&gt;You are still not expressing your needs well.  Post sample events, then post a mockup of your desired output.  It really is just that simple.  You post that and we will post the SPL.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 13:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-by-from-fields/m-p/415579#M119621</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-28T13:33:04Z</dc:date>
    </item>
  </channel>
</rss>

