<?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: Logic required. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716705#M660255</link>
    <description>Hi James RF, Thanks for script.&lt;BR /&gt;&lt;BR /&gt;Not sure where the problem is ? not showing any result in log.out although the time differance  is more than 5000 seconds.&lt;BR /&gt;&lt;BR /&gt;$ more app.log&lt;BR /&gt;2010-11-18 02:13:36.832|Warning|PipelinePairNode for fraudCheckResultAdd :: PipelinePairNode f&lt;BR /&gt;or fraudCheckAdd _response:: Generate native response for Tuxedo:: RESPONSE| Before Receipt Of&lt;BR /&gt; Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E82C3301&lt;BR /&gt;2009-11-18 04:13:39.345|Warning|PipelinePairNode for fraudCheckResultInq :: PipelinePairNode f&lt;BR /&gt;or fraudCheckResultInq _response:: Generate native response for Tuxedo:: RESPONSE| Before Rece&lt;BR /&gt;ipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E82C3301&lt;BR /&gt;&lt;BR /&gt;$  ./myscript app.log &amp;gt; log.out&lt;BR /&gt;$ more log.out&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Please correct me in execution..</description>
    <pubDate>Thu, 25 Nov 2010 11:58:05 GMT</pubDate>
    <dc:creator>Archana1</dc:creator>
    <dc:date>2010-11-25T11:58:05Z</dc:date>
    <item>
      <title>Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716699#M660249</link>
      <description>HI,&lt;BR /&gt;Looking for logic which can capture red color pattern and check  the difference of time stamp,  incase the difference is more than 5000 sec. Should put in log file.&lt;BR /&gt;Please advice ?&lt;BR /&gt;&lt;BR /&gt;TIMESTAMP Pattern 1 from log file:&lt;BR /&gt;&lt;BR /&gt;2009-07-08 02:13:36.832|Warning|PipelinePairNode for fraudCheckResultAdd :: &lt;BR /&gt;&lt;BR /&gt;TIMESTAMP Pattern 2 from same log file:&lt;BR /&gt;&lt;BR /&gt;2009-07-08 02:13:39.345|Warning|PipelinePairNode for fraudCheckResultInq :: &lt;BR /&gt;&lt;BR /&gt;TIMESTAMP Pattern 2 – TIMESTAMP Pattern 1&lt;BR /&gt;(in the above example 02:13:39 – 02:13:36 = 3 seconds)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;5000 sec&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Nov 2010 09:18:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716699#M660249</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-11-23T09:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716700#M660250</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;How do we match "red color pattern"?&lt;BR /&gt;&lt;BR /&gt;That aside, Perl would allow you to convert the date/time into Epoch seconds and then evaluate the difference to log the data you want.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 23 Nov 2010 12:44:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716700#M660250</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-23T12:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716701#M660251</link>
      <description>&lt;BR /&gt;apologies for color.&lt;BR /&gt;The script shd grep for fraudCheckResultAdd and fraudCheckResultInq , In case the time stamp is more than 5000 sec the should log into log file.&lt;BR /&gt;&lt;BR /&gt;I dont know perl much..If you give the script I can try out by executing.</description>
      <pubDate>Wed, 24 Nov 2010 09:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716701#M660251</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-11-24T09:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716702#M660252</link>
      <description>&amp;gt;The script should grep for fraudCheckResultAdd and fraudCheckResultInq, In case the time stamp is more than 5000 sec the should log into log file.&lt;BR /&gt;&lt;BR /&gt;Do these come only in pairs and not interspersed?  And you want to check the difference in timestamps between only these two?</description>
      <pubDate>Wed, 24 Nov 2010 13:59:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716702#M660252</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-24T13:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716703#M660253</link>
      <description>No takers? That would be because the problem was so poorly defined.&lt;BR /&gt;Given that we are looking for pieces of string and have to do some math, my initial tool of choice would be perl.&lt;BR /&gt;Perl has helpers for date/time manipulations. A quick google will find several (Date::Manip, Date::Parse,...)&lt;BR /&gt;Check that out.&lt;BR /&gt;&lt;BR /&gt;But here I am thinking that something simple will do.... are those times ever more than a day apart? If so then the below will NOT work.&lt;BR /&gt;Just grab the time (could even skip seconds) and add a day add a day worth of seconds if the difference is negative.&lt;BR /&gt;The code below uses a simple print.&lt;BR /&gt;You may want a 'system' call to mail or some such.&lt;BR /&gt;&lt;BR /&gt;You may also want to clarify for yourself what to do if one of the target records is missing, or repeated.&lt;BR /&gt;&lt;BR /&gt;Simple working sample, with minimal (imho) sanity checking below.&lt;BR /&gt;Stick in a file "check_inq_time.pl" and execute as&lt;BR /&gt;# perl check_inq_time.pl input.txt&lt;BR /&gt;Or embed in a shell script.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my $MAX_TIME_DIF = 2; #5000;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  next unless /\S+\s+(\d\d):(\d\d):(\d\d)/;&lt;BR /&gt;  $t = $1*3600 + $2*60 +$3;&lt;BR /&gt;  $t_add = -$t if /fraudCheckResultAdd/;&lt;BR /&gt;  if (/fraudCheckResultInq/) {&lt;BR /&gt;     die "Found INQ but no ADD" unless defined($t_add);&lt;BR /&gt;     $t_inq = $t; # just a flag for now&lt;BR /&gt;     $t_add += $t;&lt;BR /&gt;     $t_add += 86400 if $t_tadd &amp;lt; 0; # Date wrap?&lt;BR /&gt;     print "ADD/INQ Time difference $t_add is larger than  $MAX_TIME_DIF\n" unless $t_add &amp;lt; $MAX_TIME_DIF;&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;die "Found no INQ line" unless defined($t_inq);</description>
      <pubDate>Wed, 24 Nov 2010 14:17:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716703#M660253</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-11-24T14:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716704#M660254</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;You could begin with something like this:&lt;BR /&gt;&lt;BR /&gt;# cat ./myscript&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use Time::Local;&lt;BR /&gt;my $mindelta = 0; #...change as necessary...&lt;BR /&gt;my ( $line1, $line2, $delta, $time1, $time2 );&lt;BR /&gt;sub gettime {&lt;BR /&gt;    my ( $year,$mon,$day,$hour,$min,$sec ) = &lt;BR /&gt;        unpack 'a4xa2xa2xa2xa2xa2', $_[0];&lt;BR /&gt;    return timelocal( $sec,$min,$hour,$day,$mon-1,$year-1900 );&lt;BR /&gt;}&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    chomp;&lt;BR /&gt;    if ( m{fraudCheckResultAdd} ) {&lt;BR /&gt;        $line1 = $_;&lt;BR /&gt;        $time1 = gettime($_);&lt;BR /&gt;        $line2 = '';&lt;BR /&gt;        $time2 = 0;&lt;BR /&gt;    }&lt;BR /&gt;    elsif ( m{fraudCheckResultInq} &amp;amp;&amp;amp; $time1 &amp;gt; 0 ) {&lt;BR /&gt;        $line2 = $_;&lt;BR /&gt;        $time2 = gettime($_);&lt;BR /&gt;        if ( ($delta = $time2-$time1) &amp;gt;= $mindelta ) {&lt;BR /&gt;            print "$line1\n", "$line2\n", "Delta = $delta\n";&lt;BR /&gt;        }&lt;BR /&gt;        $time1 = $time2 = 0;            &lt;BR /&gt;        $line1 = $line2 = '';&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./myscript logfile &amp;gt; log.out&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 15:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716704#M660254</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-24T15:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716705#M660255</link>
      <description>Hi James RF, Thanks for script.&lt;BR /&gt;&lt;BR /&gt;Not sure where the problem is ? not showing any result in log.out although the time differance  is more than 5000 seconds.&lt;BR /&gt;&lt;BR /&gt;$ more app.log&lt;BR /&gt;2010-11-18 02:13:36.832|Warning|PipelinePairNode for fraudCheckResultAdd :: PipelinePairNode f&lt;BR /&gt;or fraudCheckAdd _response:: Generate native response for Tuxedo:: RESPONSE| Before Receipt Of&lt;BR /&gt; Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E82C3301&lt;BR /&gt;2009-11-18 04:13:39.345|Warning|PipelinePairNode for fraudCheckResultInq :: PipelinePairNode f&lt;BR /&gt;or fraudCheckResultInq _response:: Generate native response for Tuxedo:: RESPONSE| Before Rece&lt;BR /&gt;ipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E82C3301&lt;BR /&gt;&lt;BR /&gt;$  ./myscript app.log &amp;gt; log.out&lt;BR /&gt;$ more log.out&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Please correct me in execution..</description>
      <pubDate>Thu, 25 Nov 2010 11:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716705#M660255</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-11-25T11:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716706#M660256</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Not sure where the problem is ? not showing any result in log.out although the time differance is more than 5000 seconds.&lt;BR /&gt;&lt;BR /&gt;That's because your difference is a *negative* value.  Based on your original data, the "Inq" record is expected to be later in time than the "Add" record.&lt;BR /&gt;&lt;BR /&gt;The second set of data you presented uses the year 2010 and *then* the year 2009.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Nov 2010 13:08:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716706#M660256</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-25T13:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716707#M660257</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;By the way, when you are happy with the answers you have received, please read the following about the points system and their assignments:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Nov 2010 13:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716707#M660257</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-25T13:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716708#M660258</link>
      <description>&amp;gt;JRF: That's because your difference is a *negative* value.&lt;BR /&gt;&lt;BR /&gt;Perhaps the input needs to be sorted, or the absolute value used.</description>
      <pubDate>Thu, 25 Nov 2010 13:40:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716708#M660258</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-25T13:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716709#M660259</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis: Perhaps the input needs to be sorted, or the absolute value used.&lt;BR /&gt;&lt;BR /&gt;Of course.  And if we had a better problem definition, the necessity or lack thereof would be clear.&lt;BR /&gt;&lt;BR /&gt;Since Perl has an 'abs()' function one could change:&lt;BR /&gt;&lt;BR /&gt;if ( ($delta = $time2-$time1) &amp;gt;= $mindelta ) {&lt;BR /&gt;&lt;BR /&gt;..to:&lt;BR /&gt;&lt;BR /&gt;if ( ($delta = abs($time2-$time1)) &amp;gt;= $mindelta ) {&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;However, a clearer problem statement eliminates the guessing.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Nov 2010 14:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716709#M660259</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-25T14:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716710#M660260</link>
      <description>The script I presented in an earlier reply worked just fine with the crappy sample data, as it ignored the date.&lt;BR /&gt;Grins,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Nov 2010 14:18:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716710#M660260</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-11-25T14:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716711#M660261</link>
      <description>Hello JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for your script its my typo in scrap log file. Apologies for same.&lt;BR /&gt;&lt;BR /&gt;$ more log.out&lt;BR /&gt;2010-11-18 02:13:36.832|Warning|PipelinePairNode for fraudCheckResultAdd :: Pipe&lt;BR /&gt;linePairNode for fraudCheckAdd _response:: Generate native response for Tuxedo::&lt;BR /&gt; RESPONSE| Before Receipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E&lt;BR /&gt;82C3301&lt;BR /&gt;2010-11-18 04:13:39.345|Warning|PipelinePairNode for fraudCheckResultInq :: Pipe&lt;BR /&gt;linePairNode for fraudCheckResultInq _response:: Generate native response for Tu&lt;BR /&gt;xedo:: RESPONSE| Before Receipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C&lt;BR /&gt;-0305E82C3301&lt;BR /&gt;Delta = 7203&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this expected in log.out&lt;BR /&gt;&lt;BR /&gt;Iam glad that I started learning perl scripting now..</description>
      <pubDate>Thu, 25 Nov 2010 14:30:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716711#M660261</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-11-25T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716712#M660262</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is this expected in log.out&lt;BR /&gt;&lt;BR /&gt;Yes.  I assumed that you wanted to log the pair of records that triggered meeting the condition (a time difference greater than or equal to '$mindelta' written to the output.  I added the time difference too.&lt;BR /&gt;&lt;BR /&gt;As I originally noted, you can run the script passing the input file as an argument and redirecting the STDOUT stream to a file:&lt;BR /&gt;&lt;BR /&gt;# ./myscript logfile &amp;gt; log.out&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Nov 2010 14:40:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716712#M660262</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-25T14:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716713#M660263</link>
      <description>Hi JRF, &lt;BR /&gt;One more concern, when I test with real log file below are the messages and log.out is empty.&lt;BR /&gt;&lt;BR /&gt;$ ./myscript app &amp;gt; log.out&lt;BR /&gt;Use of uninitialized value in numeric gt (&amp;gt;) at ./myperl line 14, &amp;lt;&amp;gt; line 10.&lt;BR /&gt;Use of uninitialized value in numeric gt (&amp;gt;) at ./myperl line 14, &amp;lt;&amp;gt; line 20.&lt;BR /&gt;Use of uninitialized value in numeric gt (&amp;gt;) at ./myperl line 14, &amp;lt;&amp;gt; line 30.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your time. Seeming script tweaking is required.</description>
      <pubDate>Thu, 25 Nov 2010 14:43:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716713#M660263</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-11-25T14:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716714#M660264</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; when I test with real log file below are the messages and log.out is empty.&lt;BR /&gt;&lt;BR /&gt;The output is null because there are no "fraudCheckResultAdd" records.&lt;BR /&gt;&lt;BR /&gt;As for the warnings from Perl, I should have initialized the variables.  Change:&lt;BR /&gt;&lt;BR /&gt;my ( $line1, $line2, $delta, $time1, $time2 );&lt;BR /&gt;&lt;BR /&gt;...to:&lt;BR /&gt;&lt;BR /&gt;my ( $line1, $line2, $delta, $time1, $time2 ) = ( '', '', 0, 0, 0 );&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Haste makes waste :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Nov 2010 15:02:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/logic-required/m-p/4716714#M660264</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-11-25T15:02:04Z</dc:date>
    </item>
  </channel>
</rss>

