Programming Languages: Perl
License: GNU General Public License version 2.0 (GPLv2)
browse code,
statistics svn co https://swatch.svn.sourceforge.net/svnroot/swatch swatch
Swatch strips the newline of messages tailed from a logfile. However when printing the message to pipe (in Actions.pm) the newline should get restored and let the receiving end deal with the original message line. For piping to logger for example the newline is necessary since logger keeps reading until it finds a newline.
2012-05-11 05:34:12 PDT by ku1111
I did verify that Term::ANSIColor is installed on this system....Created a quick and dirty perl program that imported the module...No errors found. -- redmage123.
2012-03-15 06:22:17 PDT by redmage123
No help here. For what it is worth, I've been running swatch since the mid-90s and don't recall ever seeing that message. Currently, swatch-3.2.3, perl-5.12.2, CentOS 5.8 But let's see. Line 68 of Actions.pm lives inside the 'echo' subroutine, which handles executing the 'echo' command -- that makes sense, given your config file: print colored("$args{'MESSAGE'}\n"...
2012-03-15 06:15:06 PDT by skendric
Hello all, I'm running SWATCH on a RHEL6 system. The installed rpm is: swatch-3.2.3-2.el6.noarch I run swatch as a daemon process, the problem is that when it finds a pattern, it crashes out with the following error: ^[[1m2012-03-15T09:17:03.223733+00:00 metstore bbrelin: SYSMON WARNING - polling /var/adm/messages from www1 failed ^[[0mInvalid attribute name "failed at...
2012-03-15 04:27:50 PDT by redmage123
I have struggled with doing this myself, unsuccessfully. If you figure out how, plse post. your solution. --sk.
2012-03-08 05:30:10 PST by skendric
I have an application that logs error events in this format: [i]2012-03-08 08:15:29,512 ERROR [methodName] (userId) (sessionId) descriptive error text[/i] In my swatch config, I have a handful of ignore statements for ERROR events I'm not interested in, then as a 'catch-all' I have this: watchfor /ERROR\s\[\w+\]/ threshold track_by=expr1,type=both,count=5,seconds=300...
2012-03-08 02:52:50 PST by de9hdsa
Current workaround: In swatch.conf: watchfor /foobar/ perlcode 2 $_ =~ s/'/´/g; echo exec /usr/local/bin/alert.sh '$_' In alert.sh, I then use echo "$*" | sed s/´/\'/g to switch back to the normal single quote. Ugly workaround. Is there a better way? PS. apparently, the "perlcode 2" statement is always executed prior to the...
2011-11-30 07:44:57 PST by elof
Using exec while having special characters in the log data fails. I've concluded that the best way is to quote the $_ with single quotes: watchfor /foobar/ echo exec /usr/local/bin/alert.sh '$_' This way, all kinds of strange chars, such as parenthesis and back-quote, are sent correctly to my script alert.sh. However, if the line contain a single quote, as in "foobar can't...
2011-11-30 06:09:38 PST by elof