I have a large log file, which I want to first use grep to get the specific lines then send it to awk to print out the specific column and if the result is zero, don't do anything. What I have so far is:
LOGDIR=/usr/local/oracle/Transcription/log
ERRDIR=/home/edixftp/errors
#I want to be... (3 Replies)
Hi Experts,
Im a new bee for scripting,
I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
I need help in parsing the following log files.
10 Apr 2009 0:16:16 * name: Tuna Belly Format: Well done, Price: 999 only
10 Apr 2009 0:16:16 * name: Roast Beef Format: Raw, Price: 55 c
10 Apr 2009 0:16:16 * name: Pasta Format: Dry, Price: 88.43 only
etcetc
I need to parse this... (8 Replies)
I'm new to scripting and was wondering if there was a way to accomplish what I want below using shell script(s).
If there is a log file as follows, where the id is the unique id of a process, with the timestamp of when the process began and completed displayed, would it be possible to find the... (3 Replies)
Hi
i have a log file, which keeps appending, i want to find "exceptions" in that log file and copy those exceptions to another file.
i am using
grep exception filename >> location where to copy
but as the file is appending, am not able to view.
i am using
tail -f command ,
... (5 Replies)
Working on a script that inputs an IP, parses and outputs to another file.
A Sample of the log is as follows:
I need the script to be able to input IP and print the data in an output file in the following format or something similar:
Thanks for any help you can give me! (8 Replies)
Hello all,
I am new to scripting and I have written a script that performs an Rsync on my NAS and then moves on to send me an email with the status etc. The problem is that I think Rsync is taking to long to complete and the IF statement is timing out, as it doesn't appear to move on.
Here... (1 Reply)
Hi,
I am a newbie to scripting.
I have multiple log files (saved as .gz) in a directory that looks like this
01-01-2013 10:00 pn: 123
01-01-2013 10:00 sn: 987
01-01-2013 10:00 Test1
01-01-2013 10:00 Result: Pass
01-01-2013 10:00 Time: 5:00
01-01-2013 10:00 Test2
01-01-2013 10:00... (3 Replies)
I want to parse a log file which i am grepping root user connection but is showing whole day and previous day detail as well.
First i want to see last 2 hours log file then after that i want to search particular string. Lets suppose right now its 5:00PM, So i want to see the log of 3:00PM to... (6 Replies)
Hi,
I have a log file that looks like below and I am wanting to know if there is a better way of parsing it from how I am doing it right now.
I am looking for when an application service is OFFLINE and ONLINE. This log file is getting written into every 30 minutes
... (1 Reply)
Discussion started by: newbie_01
1 Replies
LEARN ABOUT DEBIAN
log::contextual::teelogger
Log::Contextual::TeeLogger(3pm) User Contributed Perl Documentation Log::Contextual::TeeLogger(3pm)NAME
Log::Contextual::TeeLogger - Output to more than one logger
SYNOPSIS
use Log::Contextual::SimpleLogger;
use Log::Contextual::TeeLogger;
use Log::Contextual qw( :log ),
-logger => Log::Contextual::TeeLogger->new({ loggers => [
Log::Contextual::SimpleLogger->new({ levels => [ 'debug' ] }),
Log::Contextual::SimpleLogger->new({
levels => [ 'info' ],
coderef => sub { print @_ },
}),
]});
## docs below here not yet edited
log_info { 'program started' }; # no-op because info is not in levels
sub foo {
log_debug { 'entered foo' };
...
}
DESCRIPTION
This module is a simple logger made mostly for demonstration and initial experimentation with Log::Contextual. We recommend you use a real
logger instead. For something more serious but not overly complicated, take a look at Log::Dispatchouli.
METHODS
new
Arguments: "Dict[ levels => ArrayRef[Str], coderef => Optional[CodeRef] ] $conf"
my $l = Log::Contextual::SimpleLogger->new({
levels => [qw( info warn )],
coderef => sub { print @_ }, # the default prints to STDERR
});
Creates a new SimpleLogger object with the passed levels enabled and optionally a "CodeRef" may be passed to modify how the logs are
output/stored.
Levels may contain:
trace
debug
info
warn
error
fatal
$level
Arguments: @anything
All of the following six methods work the same. The basic pattern is:
sub $level {
my $self = shift;
print STDERR "[$level] " . join qq{
}, @_;
if $self->is_$level;
}
trace
$l->trace( 'entered method foo with args ' join q{,}, @args );
debug
$l->debug( 'entered method foo' );
info
$l->info( 'started process foo' );
warn
$l->warn( 'possible misconfiguration at line 10' );
error
$l->error( 'non-numeric user input!' );
fatal
$l->fatal( '1 is never equal to 0!' );
is_$level
All of the following six functions just return true if their respective level is enabled.
is_trace
say 'tracing' if $l->is_trace;
is_debug
say 'debuging' if $l->is_debug;
is_info
say q{info'ing} if $l->is_info;
is_warn
say 'warning' if $l->is_warn;
is_error
say 'erroring' if $l->is_error;
is_fatal
say q{fatal'ing} if $l->is_fatal;
AUTHOR
See "AUTHOR" in Log::Contextual
COPYRIGHT
See "COPYRIGHT" in Log::Contextual
LICENSE
See "LICENSE" in Log::Contextual
perl v5.10.1 2010-07-09 Log::Contextual::TeeLogger(3pm)