<?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: How to derive earliest and latest from the subquery? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594174#M206801</link>
    <description>&lt;P&gt;What is the point? Since from what you showed so far you'd be modifying a search with results from the same search which seems a bit pointless.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 04:55:22 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-04-19T04:55:22Z</dc:date>
    <item>
      <title>How to derive earliest and latest from the subquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593709#M206657</link>
      <description>&lt;P&gt;index=app1 [search index=app1 "orderid"| fields id]&lt;/P&gt;
&lt;P&gt;How do I modify the above query wherein "search index=app1 "orderid"| fields id" query is run and its first event's time and the last event's time is take as&amp;nbsp;&amp;nbsp;earliest and&amp;nbsp;latest time respectively for the query, "index=app1"&lt;/P&gt;
&lt;P&gt;thus it would look sometime like&lt;/P&gt;
&lt;P&gt;index=app1&amp;nbsp;earliest=x latest=y [search index=app1 "orderid"| fields id]&lt;/P&gt;
&lt;P&gt;wherein the values x and y is the first and last event's datetime of the query, "search index=app1 "orderid"| fields id"&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 16:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593709#M206657</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-04-14T16:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593718#M206659</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244042"&gt;@msg4sunil&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=app1 [ search index=app1 "orderid" | addinfo | rename info_max_time AS latest info_min_time AS earliest | fields id earliest latest ]&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 06:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593718#M206659</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-14T06:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593719#M206660</link>
      <description>&lt;P&gt;Should work, i.e. pass the earliest and latest out from the subsearch&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=app1 [
  search index=app1 "orderid"
  | stats latest(_time) as latest earliest(_time) as earliest values(id) 
  | fields id earliest latest
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 06:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593719#M206660</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-14T06:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593737#M206667</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, sorry its not working me&lt;/P&gt;&lt;P&gt;The results of both doesnt match since the ID's are different&lt;/P&gt;&lt;P&gt;index=app1 "order1"&lt;BR /&gt;| stats count by id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index=app1 [&lt;BR /&gt;search index=app1 "order1"&lt;BR /&gt;| stats latest(_time) as latest earliest(_time) as earliest values(id)&lt;BR /&gt;| fields id earliest latest&lt;BR /&gt;]&lt;BR /&gt;| stats count by id&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 08:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593737#M206667</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-04-14T08:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593741#M206668</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;, its pretty close but not exact.&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=app1 "order1"| stats count by id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index=app1 [ search index=app1 "orderid" | addinfo | rename info_max_time AS latest info_min_time AS earliest | fields id earliest latest ]|stats count by id&lt;/P&gt;&lt;P&gt;Comparing the output of the above command, while most of the ID's matched based on the above but not all.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 08:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593741#M206668</guid>
      <dc:creator>msg4sunil</dc:creator>
      <dc:date>2022-04-14T08:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593757#M206674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244042"&gt;@msg4sunil&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you understand which are the not matching IDs?&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 09:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/593757#M206674</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-14T09:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Derive earliest and latest from the subquery</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594158#M206794</link>
      <description>&lt;P&gt;Can you explain what you mean by the ids are different?&lt;/P&gt;&lt;P&gt;What IDs are you referring to and can you provide an example of how the outer and inner searches are supposed to filter each other?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 23:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594158#M206794</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-18T23:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to derive earliest and latest from the subquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594174#M206801</link>
      <description>&lt;P&gt;What is the point? Since from what you showed so far you'd be modifying a search with results from the same search which seems a bit pointless.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 04:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594174#M206801</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-19T04:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to derive earliest and latest from the subquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594189#M206809</link>
      <description>&lt;P&gt;Is id required as part of the filtering or just earliest and latest times from the events which match orderid?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=app1 [
  search index=app1 "orderid"
  | stats latest(_time) as latest earliest(_time) as earliest
  | fields earliest latest
]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Apr 2022 06:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-derive-earliest-and-latest-from-the-subquery/m-p/594189#M206809</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-19T06:38:04Z</dc:date>
    </item>
  </channel>
</rss>

