<?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 do you alert on a date change in Windows Security Logs? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380755#M68709</link>
    <description>&lt;P&gt;Hello @zmmt,&lt;/P&gt;

&lt;P&gt;Convert your timestamps to epoch objects using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions"&gt;strptime()&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Then you can easily calculate the time difference in seconds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 | fields - _time
| eval Previous_Time="2018-12-26T09:36:32.959975900Z"
| eval New_Time="2018-12-26T09:36:32.959000000Z"
| eval Previous_Time_Epoch=strptime(Previous_Time,"%Y-%m-%dT%H:%M:%S.%9N")
| eval New_Time_Epoch=strptime(New_Time,"%Y-%m-%dT%H:%M:%S.%9N")
| eval diff=abs(New_Time_Epoch-Previous_Time_Epoch)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result for your sample event is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Previous_Time_Epoch    New_Time_Epoch        diff
 1545816992.959975      1545816992.959000     0.000975
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And now filter for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search diff&amp;gt;60
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure though what the "Z" in your timestamps stands for.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Dec 2018 14:22:00 GMT</pubDate>
    <dc:creator>whrg</dc:creator>
    <dc:date>2018-12-26T14:22:00Z</dc:date>
    <item>
      <title>How do you alert on a date change in Windows Security Logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380754#M68708</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I am looking to create an alert when a date change of more than a minute in Windows Security Logs.&lt;/P&gt;

&lt;P&gt;in my log, I have these two elements (Previous_Time and Nex_Time) that I would like to compare, but I cannot create the filter.&lt;/P&gt;

&lt;P&gt;Previous Time: ‎2018‎-‎12‎-‎26T09:36:32.959975900Z &lt;BR /&gt;
New Time: ‎2018‎-‎12‎-‎26T09:36:32.959000000Z&lt;/P&gt;

&lt;P&gt;I would like to compare these two variables and trigger an alert if the result is greater than one minute.&lt;/P&gt;

&lt;P&gt;Any ideas ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:32:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380754#M68708</guid>
      <dc:creator>zmmt</dc:creator>
      <dc:date>2020-09-29T22:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you alert on a date change in Windows Security Logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380755#M68709</link>
      <description>&lt;P&gt;Hello @zmmt,&lt;/P&gt;

&lt;P&gt;Convert your timestamps to epoch objects using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions"&gt;strptime()&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Then you can easily calculate the time difference in seconds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 | fields - _time
| eval Previous_Time="2018-12-26T09:36:32.959975900Z"
| eval New_Time="2018-12-26T09:36:32.959000000Z"
| eval Previous_Time_Epoch=strptime(Previous_Time,"%Y-%m-%dT%H:%M:%S.%9N")
| eval New_Time_Epoch=strptime(New_Time,"%Y-%m-%dT%H:%M:%S.%9N")
| eval diff=abs(New_Time_Epoch-Previous_Time_Epoch)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result for your sample event is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Previous_Time_Epoch    New_Time_Epoch        diff
 1545816992.959975      1545816992.959000     0.000975
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And now filter for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search diff&amp;gt;60
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure though what the "Z" in your timestamps stands for.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 14:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380755#M68709</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-26T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you alert on a date change in Windows Security Logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380756#M68710</link>
      <description>&lt;P&gt;hi @zmmt,&lt;/P&gt;

&lt;P&gt;Did you have a chance to check out WHRG's answer? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help ya. &lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 00:05:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-alert-on-a-date-change-in-Windows-Security-Logs/m-p/380756#M68710</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2019-01-08T00:05:02Z</dc:date>
    </item>
  </channel>
</rss>

