<?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: Extract field from group with minimum timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544168#M154143</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;after stats comand please create your triggered_time field with eval:&lt;/P&gt;&lt;P&gt;| eval T&lt;SPAN&gt;RIGGER_TYPE=if[please here create your condition with e2 fields]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://splunkonbigdata.com/2018/08/26/usage-of-splunk-eval-function-if/" target="_blank"&gt;https://splunkonbigdata.com/2018/08/26/usage-of-splunk-eval-function-if/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;after this order your output with&amp;nbsp; a table comand or other stats comand&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 11:28:39 GMT</pubDate>
    <dc:creator>aasabatini</dc:creator>
    <dc:date>2021-03-17T11:28:39Z</dc:date>
    <item>
      <title>Extract field from group with minimum timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544159#M154138</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="agh_0-1615978991460.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13350i8E707063E35F8AEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="agh_0-1615978991460.png" alt="agh_0-1615978991460.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a query like this where i group by REQUEST_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eventtype=sfdc-event-log EVENT_TYPE="ApexTrigger" REQUEST_ID!="" | stats sum(EXEC_TIME) as e1, min(TIMESTAMP_DERIVED) as e2 by REQUEST_ID | eval e1=e1/1000 | sort -e1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a new field in this output called TRIGGER_TYPE and display only that trigger_type from each group which has the minimum TIMESTAMP_DERIVED field (e2). (Note that TIMESTAMP_DERIVED is my custom timestamp field)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see I can get a list of all the trigger types in each group with list(TRIGGER_TYPE) but i only want the TRIGGER_TYPE which has a specific value for the TIMESTAMP_DERIVED field.&lt;/P&gt;&lt;P&gt;Any ideas on how this can be achieved?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 11:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544159#M154138</guid>
      <dc:creator>agh</dc:creator>
      <dc:date>2021-03-17T11:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from group with minimum timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544168#M154143</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;after stats comand please create your triggered_time field with eval:&lt;/P&gt;&lt;P&gt;| eval T&lt;SPAN&gt;RIGGER_TYPE=if[please here create your condition with e2 fields]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://splunkonbigdata.com/2018/08/26/usage-of-splunk-eval-function-if/" target="_blank"&gt;https://splunkonbigdata.com/2018/08/26/usage-of-splunk-eval-function-if/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;after this order your output with&amp;nbsp; a table comand or other stats comand&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 11:28:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544168#M154143</guid>
      <dc:creator>aasabatini</dc:creator>
      <dc:date>2021-03-17T11:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from group with minimum timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544169#M154144</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232591"&gt;@agh&lt;/a&gt;,&lt;BR /&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eventtype=sfdc-event-log EVENT_TYPE="ApexTrigger" REQUEST_ID!="" | eventstats min(TIMESTAMP_DERIVED) as TIMESTAMP_DERIVED_min by REQUEST_ID | eval trigger_type_min=if(TIMESTAMP_DERIVED=TIMESTAMP_DERIVED_min, TRIGGER_TYPE, "") | stats sum(EXEC_TIME) as e1, min(TIMESTAMP_DERIVED) as e2, max(trigger_type_min) as TRIGGER_TYPE by REQUEST_ID | eval e1=e1/1000 | sort -e1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 11:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544169#M154144</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-03-17T11:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from group with minimum timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544172#M154145</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="agh_0-1615981155116.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13353iD179B8C59622F5D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="agh_0-1615981155116.png" alt="agh_0-1615981155116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried this&amp;nbsp;&lt;/P&gt;&lt;P&gt;eventtype=sfdc-event-log EVENT_TYPE="ApexTrigger" REQUEST_ID!="" | stats sum(EXEC_TIME) as e1, min(TIMESTAMP_DERIVED) as e2 by REQUEST_ID | eval a1=if(TIMESTAMP_DERIVED==e2, TRIGGER_TYPE, "not_first") | eval e1=e1/1000 | sort -e1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;trying to output TRIGGER_TYPE field, but a1 is always "not_first". I tried changing the true false outputs, but looks like the field TRIGGER_TYPE is not outputted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 11:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544172#M154145</guid>
      <dc:creator>agh</dc:creator>
      <dc:date>2021-03-17T11:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field from group with minimum timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544213#M154154</link>
      <description>&lt;P&gt;this doesnt seem to give correct output, and also takes a lot of time to process (5+ min)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 14:59:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-field-from-group-with-minimum-timestamp/m-p/544213#M154154</guid>
      <dc:creator>agh</dc:creator>
      <dc:date>2021-03-17T14:59:37Z</dc:date>
    </item>
  </channel>
</rss>

