<?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 results only if Previous_Time and New_Time difference is more than 5s in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654366#M110932</link>
    <description>&lt;P&gt;Still not working... As I already spent too much time on this search I'm going with regex as below:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;| rex field=Previous_Time "T(?P&amp;lt;Previous_Time&amp;gt;.([0-9]+(:[0-9]+)+))" &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;| rex field=New_Time "T(?P&amp;lt;New_Time&amp;gt;.([0-9]+(:[0-9]+)+))"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and then I will use "where" for the other filtering about the exact difference I want to choose (which also shall remain anonymized).&lt;/P&gt;&lt;P&gt;Thank you for your replies and your time!&lt;BR /&gt;Best regards.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 13:06:42 GMT</pubDate>
    <dc:creator>evallja</dc:creator>
    <dc:date>2023-08-15T13:06:42Z</dc:date>
    <item>
      <title>How to return results only if Previous_Time and New_Time difference is more than 5s?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654345#M110924</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I have the below fields and I want the search to generate only the results when&amp;nbsp;&lt;STRONG&gt;Previous_Time&lt;/STRONG&gt; and &lt;STRONG&gt;New_Time&lt;/STRONG&gt; difference is more than 5s:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;_time&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;host&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;EventCode&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;EventCodeDescription&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;Previous_Time&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;New_Time&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Tue Aug 15 09:35:01 2023&lt;/TD&gt;
&lt;TD&gt;hostname&lt;/TD&gt;
&lt;TD&gt;4616&lt;/TD&gt;
&lt;TD&gt;The system time was changed.&lt;/TD&gt;
&lt;TD&gt;C:\Program Files (x86)\TrueTime\WinSync\WinSync.exe&lt;/TD&gt;
&lt;TD&gt;‎2023‎-‎08‎-‎15T07:35:01.152758200Z&lt;/TD&gt;
&lt;TD&gt;‎2023‎-‎08‎-‎15T07:35:01.152000000Z&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 19:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654345#M110924</guid>
      <dc:creator>evallja</dc:creator>
      <dc:date>2023-08-15T19:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654349#M110925</link>
      <description>&lt;P&gt;You need to parse the time strings into numeric times, then you can calculate the difference&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Previous_Time=strptime(Previous_Time,"%Y-%m-%dT%T.%9N%Z")
| eval New_Time=strptime(New_Time,"%Y-%m-%dT%T.%9N%Z")
| eval diff=abs(Previous_Time - New_Time)
| where diff &amp;gt; 5&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 10:16:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654349#M110925</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T10:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654356#M110926</link>
      <description>&lt;P&gt;I have tried the eval command before for this case, but just like in this search, it will return blank field values for&amp;nbsp;&lt;STRONG&gt;Previous_Time&lt;/STRONG&gt; and &lt;STRONG&gt;New_Time &lt;/STRONG&gt;fields.&lt;/P&gt;&lt;P&gt;I even tried to change their names by creating totally new fields but still the same results.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 11:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654356#M110926</guid>
      <dc:creator>evallja</dc:creator>
      <dc:date>2023-08-15T11:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654358#M110928</link>
      <description>&lt;P&gt;I am not sure I understand what the issue is - this code works with the samples you have given, although perhaps the samples are not an accurate representation of your events.&lt;/P&gt;&lt;P&gt;Please can you share anonymised samples of your actual events, preferably in a code block &amp;lt;/&amp;gt; to prevent loss of information due to formatting changes.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 11:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654358#M110928</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T11:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654362#M110930</link>
      <description>&lt;P&gt;The table is copied from the results, the only field value I &lt;SPAN&gt;anonymized&amp;nbsp;is the host value &lt;EM&gt;"hostname".&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;SPAN&gt;However, if it helps I am also pasting the _raw text changing only the sensitive info to &lt;EM&gt;"Anonymized"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;EM&gt;08/15/2023 09:35:01 AM&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;LogName=Security&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SourceName=Microsoft Windows security auditing.&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;EventCode=4616&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;EventType=0&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Type=Information&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;ComputerName=Anonymized&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;TaskCategory=Security State Change&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;OpCode=Info&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RecordNumber=828401024&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Keywords=Audit Success&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Message=The system time was changed.&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Subject:&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Security ID: Anonymized\Administrator&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Account Name: Administrator&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Account Domain: Anonymized&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Logon ID: 0x1B00AE&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Process Information:&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Process ID: 0x231c&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Name: C:\Program Files (x86)\TrueTime\WinSync\WinSync.exe&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Previous Time: ‎2023‎-‎08‎-‎15T07:35:01.152758200Z&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;New Time: ‎2023‎-‎08‎-‎15T07:35:01.152000000Z&lt;/EM&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 12:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654362#M110930</guid>
      <dc:creator>evallja</dc:creator>
      <dc:date>2023-08-15T12:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654364#M110931</link>
      <description>&lt;P&gt;Wow! you have some extra characters in there, no wonder the parsing didn't work! Please try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Previous_Time=strptime(Previous_Time,"&amp;lt;u+200e&amp;gt;%Y&amp;lt;u+200e&amp;gt;-&amp;lt;u+200e&amp;gt;%m&amp;lt;u+200e&amp;gt;-&amp;lt;u+200e&amp;gt;%dT%T.%9N%Z")
| eval New_Time=strptime(New_Time,"&amp;lt;u+200e&amp;gt;%Y&amp;lt;u+200e&amp;gt;-&amp;lt;u+200e&amp;gt;%m&amp;lt;u+200e&amp;gt;-&amp;lt;u+200e&amp;gt;%dT%T.%9N%Z")
| eval diff=abs(Previous_Time - New_Time)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 12:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654364#M110931</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T12:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return results only if Previous_Time and New_Time difference is more than 5s</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654366#M110932</link>
      <description>&lt;P&gt;Still not working... As I already spent too much time on this search I'm going with regex as below:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;| rex field=Previous_Time "T(?P&amp;lt;Previous_Time&amp;gt;.([0-9]+(:[0-9]+)+))" &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;| rex field=New_Time "T(?P&amp;lt;New_Time&amp;gt;.([0-9]+(:[0-9]+)+))"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and then I will use "where" for the other filtering about the exact difference I want to choose (which also shall remain anonymized).&lt;/P&gt;&lt;P&gt;Thank you for your replies and your time!&lt;BR /&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 13:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-return-results-only-if-Previous-Time-and-New-Time/m-p/654366#M110932</guid>
      <dc:creator>evallja</dc:creator>
      <dc:date>2023-08-15T13:06:42Z</dc:date>
    </item>
  </channel>
</rss>

