/torque-log

Parse Torque logs with Perl

Primary LanguagePerl

NAME

Torque::Log

SYNOPSIS

use Torque::Log;

# Parse a whole file
open my $f, '<', "logfile";
my $logs = Torque::Log->new->parse($f);
# $entry is an instance of Torque::Log::Entry
my ($entry) = $logs->get_entries;

# Or parse a single entry
my ($entry) = Torque::Log->new->parse_line($log_file_line);

DESCRIPTION

Parse accounting log entries generated by the Torque resource manager.

METHODS

dateparser( $format )

Instance of DateTime::Format::Strptime for parsing the time at which a log entry is from.

The default instance parses the following pattern: %m/%d/%Y %H:%M:%S

and will croak if it can't parse dates in the log entries with this format.

parse($filehandle)

Parses a log file read from $filehandle. Returns the Torque::Log instance.

parse_line($log_line)

Parses a log file line from $log_line, returns the Torque::Log::Entry instance.

add_entry(@log_entries)

Adds instances of Torque::Log::Entry to the collection of log entries.

Returns these entries.

get_entries()

Return all of the Torque::Log::Entry instances parsed by the object.

SEE ALSO

Torque

PBS::Logs

AUTHOR

Jonathan Barber - <jonathan.barber@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2013 Jonathan Barber

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.