2
2
##########################################################################
3
# $Id: onlyservice,v 1.9 2005/11/30 23:52:27 bjorn Exp $
3
# $Id: onlyservice,v 1.11 2008/05/03 15:29:06 mike Exp $
4
4
##########################################################################
6
6
########################################################
7
# This was written and is maintained by:
8
# Kirk Bauer <kirk@kaybee.org>
10
# Please send all comments, suggestions, bug reports,
11
# etc, to kirk@kaybee.org.
12
########################################################
7
## Copyright (c) 2008 Kirk Bauer
8
## Covered under the included MIT/X-Consortium License:
9
## http://www.opensource.org/licenses/mit-license.php
10
## All modifications and contributions by other persons to
11
## this script are assumed to have been donated to the
12
## Logwatch project and thus assume the above copyright
13
## and licensing terms. If you want to make contributions
14
## under your own copyright or a different license this
15
## must be explicitly stated in the contribution an the
16
## Logwatch project reserves the right to not accept such
17
## contributions. If you have made significant
18
## contributions to this script and want to claim
19
## copyright please contact logwatch-devel@logwatch.org.
20
#########################################################
14
22
# This will pick out only the wanted service from a logfile
15
23
# in the standard /var/log/messages format. Case insensitive.
22
30
while (defined($ThisLine = <STDIN>)) {
23
if ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName\[[0123456789]*\]: /io) {
26
elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*\[[0123456789]*\]: \[ID [0-9]+ $ServiceName/io) {
29
elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*: \[ID [0-9]+ $ServiceName/io) {
32
elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName: /io) {
35
elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName /io) {
31
if ($ThisLine =~ m/^... .. ..:..:..[ ]*[^ ]* $ServiceName(\[[0123456789]*\])?:? /io) {
34
elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*(\[[0123456789]*\])?: \[ID [0-9]+ $ServiceName/io) {