Agent-TCLI
view release on metacpan or search on metacpan
lib/Agent/TCLI/Package/Tail.pm view on Meta::CPAN
'num' => $num,
# 'max_lines' => $max_lines,
# 'match_times'=> $match_times,
'ttl' => 30,
# 'verbose' => $verbose,
'handler' => 'Log',
'log_name' => 'Append',
'ordered' => 0,
'request' => $request,
);
$self->Verbose("log: new test dump (".$test->dump(1).") ",3);
$self->push_test_queue($test);
}
return (1);
}
sub _preinit :Preinit {
my ($self,$args) = @_;
$args->{'name'} = 'tcli_tail';
$args->{'session'} = POE::Session->create(
object_states => [
$self => [qw(
_start
_stop
_shutdown
_default
_child
clear
establish_context
file
log
show
test
settings
Activate
Append
Check
Complete
FileReset
PruneLineCache
SetFollowTailWheel
Wally
)],
],
);
}
sub _init :Init {
my $self = shift;
$self->LoadYaml(<<'...');
---
Agent::TCLI::Parameter:
name: file
help: The full Unix path of the file name.
manual: >
The full Unix path of the file that will be tailed.
type: Param
---
Agent::TCLI::Parameter:
name: filter
help: Optional POE::Filter.
manual: >
A POE::Filter that will be applied by POE::Wheel::FollowTail on the file
being tailed.
type: Param
---
Agent::TCLI::Parameter:
name: interval
help: Seconds to wait between checks.
manual: >
Seconds to wait between checks.
type: Param
---
Agent::TCLI::Parameter:
name: seek
help: Seek forward byte count.
manual: >
The Seek parameter tells Tail how far from the start of the file to start
reading. Its value is specified in bytes, and values greater than the
file's current size will quietly cause Tail to start from the file's end.
A Seek parameter of 0 starts FollowTail at the beginning of the file.
A negative Seek parameter emulates SeekBack: it seeks backwards from
the end of the file.
Seek and SeekBack are mutually exclusive. If Seek and SeekBack are not
specified, Tail seeks 4096 bytes back from the end of the file
and discards everything until the end of the file. This helps ensure
that Tail returns only complete records.
type: Param
---
Agent::TCLI::Parameter:
name: seekback
help: Seek backwards byte count.
manual: >
The SeekBack parameter tells Tail how far back from the end of the file
to start reading. Its value is specified in bytes, and values greater
than the file's current size will quietly cause Tail to start from
the file's beginning.
A SeekBack parameter of 0 starts Tail at the end of the file.
It's recommended to omit Seek and SeekBack to start from the end of a file.
A negative SeekBack parameter emulates Seek: it seeks forwards from
the start of the file.
type: Param
---
Agent::TCLI::Parameter:
name: name
help: The name of the test.
manual: >
The name is purely cosmetic and will be returned with the test results
simliarly to the way Test::Simple operates. This might be useful
when reporting results to a group chat or log.
type: Param
---
Agent::TCLI::Parameter:
name: like
help: A regex to match.
manual: >
( run in 1.536 second using v1.01-cache-2.11-cpan-df04353d9ac )