~ubuntu-branches/ubuntu/lucid/logwatch/lucid-201002122348

« back to all changes in this revision

Viewing changes to scripts/shared/onlyservice

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-07-05 11:49:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080705114954-9naedpe6wrk3k7xt
Tags: 7.3.6.cvs20080702-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Use postfix rather than exim4.
  - Update maintainers according to spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
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
##########################################################################
5
5
 
6
6
########################################################
7
 
# This was written and is maintained by:
8
 
#    Kirk Bauer <kirk@kaybee.org>
9
 
#
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
#########################################################
13
21
 
14
22
# This will pick out only the wanted service from a logfile
15
23
# in the standard /var/log/messages format.  Case insensitive.
20
28
}
21
29
 
22
30
while (defined($ThisLine = <STDIN>)) {
23
 
    if ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName\[[0123456789]*\]: /io) {
24
 
      print $ThisLine;
25
 
    }
26
 
    elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*\[[0123456789]*\]: \[ID [0-9]+ $ServiceName/io) {
27
 
      print $ThisLine;
28
 
    }
29
 
    elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*: \[ID [0-9]+ $ServiceName/io) {
30
 
      print $ThisLine;
31
 
    }
32
 
    elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName: /io) {
33
 
      print $ThisLine;
34
 
    }
35
 
    elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* $ServiceName /io) {
 
31
    if ($ThisLine =~ m/^... .. ..:..:..[ ]*[^ ]* $ServiceName(\[[0123456789]*\])?:? /io) {
 
32
      print $ThisLine;
 
33
    }
 
34
    elsif ($ThisLine =~ m/^... .. ..:..:.. [^ ]* [^ ]*(\[[0123456789]*\])?: \[ID [0-9]+ $ServiceName/io) {
36
35
      print $ThisLine;
37
36
    }
38
37
}