I'm trying to write a script that will look in an /exports folder for the oldest export file and move it to a /staging folder. "Oldest" in this case is actually determined by date information embedded in the file names themselves.
Also, the script should only move a file from /exports to... (6 Replies)
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
I am viewing a file in vi editor and would like to search for a date pattern. In the log, the timestamp is enclosed in parentheses ''. I am using the '/' option in vi to search for the pattern.
log snippet:
000000f4 ServletWrappe I SRVE0242I: : Initialization successful.
000000f4... (3 Replies)
Looking for a shell script or a simple perl script . I am new to scripting and not very good at it .
I have 2 directories . One of them holds a text file with list of files in it and the second one is a daily log which shows the file completion time. I need to co-relate both and make a report.
... (0 Replies)
Anyone knows how to use AWK to achieve the following
Sun Feb 12 00:41:01-00:41:59 Success:2 Fail:2
Sun Feb 12 00:42:01-00:42:59 Success:1 Fail:2
Sun Feb 12 01:20:01-01:20:59 Success:1 Fail:2
Mon Feb 13 22:41:01-22:41:59 Success:1 Fail:1
log file:
Success
Success
Fail
Fail
... (9 Replies)
Hi Friends,
I am working on a file which has content as follows
Wed,Database,ABC_cube,loaded
Wed,Logging,out,user,302002654,active,for,0,minutes
Wed,Logging,out,user,109000151,active,for,8,minutes
Wed,Logging,out,user,302002654,active,for,0,minutes... (8 Replies)
I have a file like this
-------------------------------
--------------------------------------
I need a way to find the timestamp preceding the ERR-XXXXX
Here XXXX deonoes any any numeric string 00000-99999
that is a output like this
2012-11-12 : 11:59-ERR-XXXXX
2012-11-12 : ... (4 Replies)
Hi,
I have a folder with multiple (< 33) .log files.
And I have to copy the lines between two patterns from all the .log files to a new file.
(script file with a loop?)
Thanks in advance.
1.log
...
..
xx1> begin
...
..
..
>>> Total: 2 Alarms
..
.. (17 Replies)
I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :)
I have the output of an ldapsearch that looks like this:
dn: cn=sam,ou=company,o=com
uidNumber: 7174
gidNumber: 49563
homeDirectory: /home/sam
loginshell: /bin/bash
uid: sam... (2 Replies)
Hello.
Here is a file contents :
declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern
=I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '='
Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT SUSE
log::log4perl::appender::screencoloredlevels
Appender::ScreenColoredLevels(3) User Contributed Perl Documentation Appender::ScreenColoredLevels(3)NAME
Log::Log4perl::Appender::ScreenColoredLevel - Colorize messages according to level
SYNOPSIS
use Log::Log4perl qw(:easy);
Log::Log4perl->init( <<'EOT');
log4perl.category = DEBUG, Screen
log4perl.appender.Screen =
Log::Log4perl::Appender::ScreenColoredLevels
log4perl.appender.Screen.layout =
Log::Log4perl::Layout::PatternLayout
log4perl.appender.Screen.layout.ConversionPattern =
%d %F{1} %L> %m %n
EOT
# Appears black
DEBUG "Debug Message";
# Appears green
INFO "Info Message";
# Appears blue
WARN "Warn Message";
# Appears magenta
ERROR "Error Message";
# Appears red
FATAL "Fatal Message";
DESCRIPTION
This appender acts like Log::Log4perl::Appender::Screen, except that it colorizes its output, based on the priority of the message sent.
You can configure the colors and attributes used for the different levels, by specifying them in your configuration:
log4perl.appender.Screen.color.TRACE=cyan
log4perl.appender.Screen.color.DEBUG=bold blue
You can also specify nothing, to indicate that level should not have coloring applied, which means the text will be whatever the default
color for your terminal is. This is the default for debug messages.
log4perl.appender.Screen.color.DEBUG=
You can use any attribute supported by Term::ANSIColor as a configuration option.
log4perl.appender.Screen.color.FATAL=
bold underline blink red on_white
The commonly used colors and attributes are:
attributes
BOLD, DARK, UNDERLINE, UNDERSCORE, BLINK
colors
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
background colors
ON_BLACK, ON_RED, ON_GREEN, ON_YELLOW, ON_BLUE, ON_MAGENTA, ON_CYAN, ON_WHITE
See Term::ANSIColor for a complete list, and information on which are supported by various common terminal emulators.
The default values for these options are:
Trace
Yellow
Debug
None (whatever the terminal default is)
Info
Green
Warn
Blue
Error
Magenta
Fatal
Red
The constructor "new()" takes an optional parameter "stderr", if set to a true value, the appender will log to STDERR. If "stderr" is set
to a false value, it will log to STDOUT. The default setting for "stderr" is 1, so messages will be logged to STDERR by default. The
constructor can also take an optional parameter "color", whose value is a hashref of color configuration options, any levels that are not
included in the hashref will be set to their default values.
COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.1 2010-02-07 Appender::ScreenColoredLevels(3)