- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Logic required.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 06:06 AM
тАО11-25-2010 06:06 AM
Re: Logic required.
> Dennis: Perhaps the input needs to be sorted, or the absolute value used.
Of course. And if we had a better problem definition, the necessity or lack thereof would be clear.
Since Perl has an 'abs()' function one could change:
if ( ($delta = $time2-$time1) >= $mindelta ) {
..to:
if ( ($delta = abs($time2-$time1)) >= $mindelta ) {
...
However, a clearer problem statement eliminates the guessing.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 06:18 AM
тАО11-25-2010 06:18 AM
Re: Logic required.
Grins,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 06:30 AM
тАО11-25-2010 06:30 AM
Re: Logic required.
Thanks for your script its my typo in scrap log file. Apologies for same.
$ more log.out
2010-11-18 02:13:36.832|Warning|PipelinePairNode for fraudCheckResultAdd :: Pipe
linePairNode for fraudCheckAdd _response:: Generate native response for Tuxedo::
RESPONSE| Before Receipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C-0305E
82C3301
2010-11-18 04:13:39.345|Warning|PipelinePairNode for fraudCheckResultInq :: Pipe
linePairNode for fraudCheckResultInq _response:: Generate native response for Tu
xedo:: RESPONSE| Before Receipt Of Final Fraud Decision: 1F2504E0-4F89-11D3-9A0C
-0305E82C3301
Delta = 7203
Is this expected in log.out
Iam glad that I started learning perl scripting now..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 06:40 AM
тАО11-25-2010 06:40 AM
Re: Logic required.
> Is this expected in log.out
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.
As I originally noted, you can run the script passing the input file as an argument and redirecting the STDOUT stream to a file:
# ./myscript logfile > log.out
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 06:43 AM
тАО11-25-2010 06:43 AM
Re: Logic required.
One more concern, when I test with real log file below are the messages and log.out is empty.
$ ./myscript app > log.out
Use of uninitialized value in numeric gt (>) at ./myperl line 14, <> line 10.
Use of uninitialized value in numeric gt (>) at ./myperl line 14, <> line 20.
Use of uninitialized value in numeric gt (>) at ./myperl line 14, <> line 30.
Appreciate your time. Seeming script tweaking is required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2010 07:02 AM
тАО11-25-2010 07:02 AM
Re: Logic required.
> when I test with real log file below are the messages and log.out is empty.
The output is null because there are no "fraudCheckResultAdd" records.
As for the warnings from Perl, I should have initialized the variables. Change:
my ( $line1, $line2, $delta, $time1, $time2 );
...to:
my ( $line1, $line2, $delta, $time1, $time2 ) = ( '', '', 0, 0, 0 );
...
Haste makes waste :-)
Regards!
...JRF...
- « Previous
-
- 1
- 2
- Next »