<?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: Return Timestamp from inner and outter search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457545#M129234</link>
    <description>&lt;P&gt;Sorry, I read it wrong. Can you try this? tweak the time format according to your need. Hope this should help now?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4624 OR EventCode=4625 
| eval failed_time=if(EventCode=4625,strftime(_time,"%Y-%m-%dT%H:%M:%S"),"") 
|eval Success_time=if(EventCode=4624,strftime(_time,"%Y-%m-%dT%H:%M:%S"),"") 
| stats list(EventCode) as EventCode range(_time) AS duration values(failed_time) as failed_time values(Success_time) as Success_time BY ComputerName 
| rex field=duration mode=sed "s/\..*$//" 
| where duration &amp;lt;600
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Aug 2019 02:58:41 GMT</pubDate>
    <dc:creator>nareshinsvu</dc:creator>
    <dc:date>2019-08-21T02:58:41Z</dc:date>
    <item>
      <title>Return Timestamp from inner and outter search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457542#M129231</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to create a search that finds two sequential events. So far I have:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=wineventlog EventCode=4624 [ search index=wineventlog EventCode=4625 | eval earliest=_time | eval latest=_time+600 | fields earliest latest ComputerName ]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This works and returns successful windows logins that follow a failed login within a 10min period. What I want to do though is return a table that shows the time that the first event occurred and the time that the second triggering event occurred. I tried appending:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| table ComputerName earliest _time&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;But the earliest field comes back blank when I want that to be showing the time stamp fo the event that matched the subsearch.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457542#M129231</guid>
      <dc:creator>shayvdee</dc:creator>
      <dc:date>2020-09-30T01:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return Timestamp from inner and outter search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457543#M129232</link>
      <description>&lt;P&gt;Are you trying to match anything from your sub-search? if not, can you try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog earliest="-10m@m" latest="now" EventCode=4624 OR EventCode=4625 | fields _time EventCode ComputerName 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 00:59:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457543#M129232</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-21T00:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return Timestamp from inner and outter search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457544#M129233</link>
      <description>&lt;P&gt;Hi @nareshinsvu&lt;/P&gt;

&lt;P&gt;Thanks for your answer.&lt;/P&gt;

&lt;P&gt;I need to match the ComputerName from the subsearch and then use the time from the subsearch to find other events in the same time period.&lt;/P&gt;

&lt;P&gt;In the example, I want to find all successful logins over the last week that occur within 10min of a failed login on the same computer.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 01:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457544#M129233</guid>
      <dc:creator>shayvdee</dc:creator>
      <dc:date>2019-08-21T01:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Return Timestamp from inner and outter search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457545#M129234</link>
      <description>&lt;P&gt;Sorry, I read it wrong. Can you try this? tweak the time format according to your need. Hope this should help now?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4624 OR EventCode=4625 
| eval failed_time=if(EventCode=4625,strftime(_time,"%Y-%m-%dT%H:%M:%S"),"") 
|eval Success_time=if(EventCode=4624,strftime(_time,"%Y-%m-%dT%H:%M:%S"),"") 
| stats list(EventCode) as EventCode range(_time) AS duration values(failed_time) as failed_time values(Success_time) as Success_time BY ComputerName 
| rex field=duration mode=sed "s/\..*$//" 
| where duration &amp;lt;600
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 02:58:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457545#M129234</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-08-21T02:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Return Timestamp from inner and outter search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457546#M129235</link>
      <description>&lt;P&gt;Thanks. Not quite working yet, but I think you have pointed me down the right track.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 03:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-Timestamp-from-inner-and-outter-search/m-p/457546#M129235</guid>
      <dc:creator>shayvdee</dc:creator>
      <dc:date>2019-08-21T03:16:31Z</dc:date>
    </item>
  </channel>
</rss>

