Sponsored Content
Top Forums UNIX for Dummies Questions & Answers is /. superfluous? why not just say / ? Post 302079076 by james hanley on Thursday 6th of July 2006 05:57:18 PM
Old 07-06-2006
many thanks
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Perl: How to avoid warnings for superfluous values returned?

Hi all, a question for the Perl knowledgeable: I have use warnings; enabled. I use something like: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); In the further code I only work with some of the returned variables, as the others I have no need for. Though the... (1 Reply)
Discussion started by: zaxxon
1 Replies
lwatch.conf(5)							File Formats Manual						    lwatch.conf(5)

NAME
lwatch.conf -- configuration file for lwatch(1), syntax highlighting for syslog/syslog-ng file DESCRIPTION
Default configuration file for lwatch is /etc/lwatch/lwatch.conf (built-in value), but you can specify another file with -C command line option. Read lwatch(1) for details. Comments Everything from # (hash) to end of line is a comment. General options cfg_ver - this is obligatory variable and it must be placed as the first option in config file. This variable contains version of configu- ration file syntax. Current manual describes version 1. rule_action - after successful matching rule lwatch tries to match next one. You can choose to exit after executing matching rule changing this parameter from continue (that's the default) to exit. You can override this global parameter for each rule. See section Actions and modificators. use_syslog - if set to yes some messages will be logged through syslog, default is yes log_level - how verbose log messages should produce lwatch date_color - default color of date part host_color - default color of hostname part serv_color - default color of service part mesg_color - default color of message part input_file - where lwatch is reading data from, built-in default is /var/lib/lwatch/syslog.fifo, could be overwritten with command line option -i output_file - where lwatch output colored data; built-in default is stdout (-), could be overwritten with command line option -o show_unparsed - by default lwatch ignores lines which cannot be split into date, host, service and message, set this variable to yes if you would like to see those lines; it is the same as command line option -s Available colors To specify color you can use following strings: black, red, green, brown, blue, magenta, cyan, lightgray, darkgray, brightred, brightgreen, yellow, brightblue, purple, brightcyan, white. Available log levels To specify the lower visible log level you can use following strings: LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG. However, lwatch logs some debug data at LOG_DEBUG, some maybe useful messages at LOG_NOTICE and errors at LOG_ERROR. So, technically, meaningful values are: o LOG_DEBUG - log everything o LOG_NOTICE - log maybe useful messages and errors (this is the default) o LOG_ERROR - log only errors (if LOG_NOTICE is too verbose for you this is the next recommended setting) o LOG_CRIT - be quiet Please keep in mind that meaningful values may be a subject of change in future releases. Matching patterns There The True Power of Lwatch is hidden. You can match input lines against PCRE (Perl Compatible Regular Expression) and change output depends on matching. You can read more about PCRE in pcrepattern(3) (from libpcre) or in perlre(1) (from perl). There are two ways to define matching pattern/action. First one is the simple one. Just pattern and one action: /regexp/ action The second one is more complex, but it allows to specify more than one action or modificator with one pattern: /regexp/ { action1 action2 ... actionN } There is one important thing you should remember. There is no need to quote / (slash) if you use it inside regexp pattern. For example: //USR/SBIN/CRON/ { # cron's messages are not important color=blue # display it in blue match_service } Actions and modificators date_color - set date color mesg_color, color - set message color serv_color - set service name color host_color - set hostname color ignore - ignore this pattern, do not match next patterns exit - do not match next patterns when rule_action is set to continue, in other case it is superfluous continue - continue with next pattern when rule_action is set to exit, in other case it is superfluous; please note, that if ignore> is used in the same action it takes a priority - it makes no sense to match other rules for string that has been ignored highlight - highlight matched string with given color (see NOTES) match_host - match hostname insted message match_service - match service name instead message NOTES
highlight action changes the matched text. That's why the following part of configuration wont work: /root/ highlight=brown /session closed for user root/ ignore when (pam_unix) session closed for user root would appear as an input line. First rule changes the text to: (pam_unix) session closed for user [BROWN]root[NORMAL] where [BROWN] and [NORMAL] are control sequences to change color to brown, then change it back to default color of this part. Of course this line does not match the second rule and you can see it on the output. There are two possible workarounds: o put the ignore pattern before the highlight one o enhance your second rules like: /session closed for user .*root.*/ ignore EXAMPLES
Just look into provided lwatch.conf. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. This library is available at: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ SEE ALSO
lwatch(1), pcrepattern(3), perlre(1) lwatch.conf(5)
All times are GMT -4. The time now is 05:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy