<?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: Can earliest/latest function be used over my own timestamp field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556079#M157899</link>
    <description>&lt;P&gt;Yes, you can. &amp;nbsp;If you want to use search command, rename your timestamp _time; else you will need to do calculations in where command.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jun 2021 03:08:25 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2021-06-17T03:08:25Z</dc:date>
    <item>
      <title>Can earliest/latest function be used over my own timestamp field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556078#M157898</link>
      <description>&lt;P class="lia-align-left"&gt;Hi folks, my dataset looks like this:&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;timestamp&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;id&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;userMail&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;reason&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;t1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;id1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;a@example.com&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;test&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;t2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;id1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;a@example.com&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;test&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;t3&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;id1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;a@example.com&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&amp;nbsp;test&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;t2&lt;/TD&gt;&lt;TD height="25px"&gt;id2&lt;/TD&gt;&lt;TD height="25px"&gt;b@example.com&lt;/TD&gt;&lt;TD height="25px"&gt;testtest&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;t4&lt;/TD&gt;&lt;TD height="25px"&gt;id2&lt;/TD&gt;&lt;TD height="25px"&gt;b@example.com&lt;/TD&gt;&lt;TD height="25px"&gt;ttt&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;I want to group by id and userMail, then find the last (latest) record in each group. From the help document on latest/earliest function, it uses metadata field _time to find the latest row, how can I let latest function to use timestamp field in my case?&amp;nbsp;&lt;BR /&gt;I know I can use something like eval _time = timestamp to overwrite the _time field, but want to know if there are better ways to achieve.&lt;BR /&gt;&lt;BR /&gt;My second question is how to write the query, can i do in this way:&lt;BR /&gt;&lt;BR /&gt;| eval _time=timestamp/pow(10,3)&lt;BR /&gt;| chart latest(*) by id, userEmail&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 03:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556078#M157898</guid>
      <dc:creator>codewarrior</dc:creator>
      <dc:date>2021-06-17T03:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can earliest/latest function be used over my own timestamp field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556079#M157899</link>
      <description>&lt;P&gt;Yes, you can. &amp;nbsp;If you want to use search command, rename your timestamp _time; else you will need to do calculations in where command.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 03:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556079#M157899</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-06-17T03:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can earliest/latest function be used over my own timestamp field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556115#M157909</link>
      <description>If needed you could add new field (or convert timestamp) for epoch time (time in seconds). Then just look min/max from this values and then add values(timestamp) as timestamp your query or convert that min/max value back to displayable format.&lt;BR /&gt;r. Ismo</description>
      <pubDate>Thu, 17 Jun 2021 06:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556115#M157909</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-06-17T06:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can earliest/latest function be used over my own timestamp field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556131#M157915</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235510"&gt;@codewarrior&lt;/a&gt;&amp;nbsp;wrote:&lt;P class="lia-align-left"&gt;My second question is how to write the query, can i do in this way:&lt;BR /&gt;&lt;BR /&gt;| eval _time=timestamp/pow(10,3)&lt;BR /&gt;| chart latest(*) by id, userEmail&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Also yes. &amp;nbsp;As soon as you redefine _time, it behaves as the original _time. (In some use cases, you want to first rename the original in order to save its value. &amp;nbsp;But for the stats that you are using it with, that is not necessary.)&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 07:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-earliest-latest-function-be-used-over-my-own-timestamp-field/m-p/556131#M157915</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-06-17T07:39:41Z</dc:date>
    </item>
  </channel>
</rss>

