Linux: logwatch(8) is too noisy. How can I control the noise level?FreeBSD: periodic(8) is too noisy. How can...

Function pointer with named arguments?

How to pronounce 'c++' in Spanish

How come there are so many candidates for the 2020 Democratic party presidential nomination?

What is the smallest unit of eos?

bldc motor, esc and battery draw, nominal vs peak

Initiative: Do I lose my attack/action if my target moves or dies before my turn in combat?

How to prevent z-fighting in OpenSCAD?

Rivers without rain

How to write a column outside the braces in a matrix?

Why do games have consumables?

A ​Note ​on ​N!

Elements other than carbon that can form many different compounds by bonding to themselves?

Was there a shared-world project before "Thieves World"?

Is it idiomatic to construct against `this`

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

Phrase for the opposite of "foolproof"

Is the claim "Employers won't employ people with no 'social media presence'" realistic?

What does ゆーか mean?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Mistake in years of experience in resume?

Can I grease a crank spindle/bracket without disassembling the crank set?

Aligning equation numbers vertically

555 timer FM transmitter

Why does nature favour the Laplacian?



Linux: logwatch(8) is too noisy. How can I control the noise level?


FreeBSD: periodic(8) is too noisy. How can I control the noise level?Logwatch: Ignore certain IPs for SSH & PAM checks?Suppress log messages about minor 3ware disk temperature changes on CentOS?Receive email alerts from Linux file serverHybrid gmail MX + postfix for local accountsHow can I get logwatch to process alternate apache logs?FreeBSD: periodic(8) is too noisy. How can I control the noise level?How to change “sender:” field in the header of Logwatch emailsHow do I block an email sender using SSHHow to set up Logwatch to receive high level messages immediately?Change the sender email of logwatch on RH LinuxHow to retrieve all the system mails like LogWatchHow can I modify the disk space output of Logwatch?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







30















Our Linux systems run logwatch(8) utility by default. On a RedHat/CentOS/SL system, Logwatch is called by the /etc/cron.daily/ cronjob, which then sends a daily email with the results. These emails have a subject like:



Subject: Logwatch for $HOSTNAME


The problem is that by default these daily emails are too noisy and contain a lot of superfluous information (HTTP errors, daily disk usage, etc) which are already monitored by other services (Nagios, Cacti, central syslog, etc). For 100 systems, the email load is unbearable. People ignore the emails, which means that we may miss problems which are picked up by logwatch.



How can I reduce the amount of noise generated by logwatch, but still use logwatch to notify us of significant problems?



I'll post my own answer below, but I would like to see what others have done.



Note: I have a similar question regarding FreeBSD, at FreeBSD: periodic(8) is too noisy. How can I control the noise level?










share|improve this question































    30















    Our Linux systems run logwatch(8) utility by default. On a RedHat/CentOS/SL system, Logwatch is called by the /etc/cron.daily/ cronjob, which then sends a daily email with the results. These emails have a subject like:



    Subject: Logwatch for $HOSTNAME


    The problem is that by default these daily emails are too noisy and contain a lot of superfluous information (HTTP errors, daily disk usage, etc) which are already monitored by other services (Nagios, Cacti, central syslog, etc). For 100 systems, the email load is unbearable. People ignore the emails, which means that we may miss problems which are picked up by logwatch.



    How can I reduce the amount of noise generated by logwatch, but still use logwatch to notify us of significant problems?



    I'll post my own answer below, but I would like to see what others have done.



    Note: I have a similar question regarding FreeBSD, at FreeBSD: periodic(8) is too noisy. How can I control the noise level?










    share|improve this question



























      30












      30








      30


      11






      Our Linux systems run logwatch(8) utility by default. On a RedHat/CentOS/SL system, Logwatch is called by the /etc/cron.daily/ cronjob, which then sends a daily email with the results. These emails have a subject like:



      Subject: Logwatch for $HOSTNAME


      The problem is that by default these daily emails are too noisy and contain a lot of superfluous information (HTTP errors, daily disk usage, etc) which are already monitored by other services (Nagios, Cacti, central syslog, etc). For 100 systems, the email load is unbearable. People ignore the emails, which means that we may miss problems which are picked up by logwatch.



      How can I reduce the amount of noise generated by logwatch, but still use logwatch to notify us of significant problems?



      I'll post my own answer below, but I would like to see what others have done.



      Note: I have a similar question regarding FreeBSD, at FreeBSD: periodic(8) is too noisy. How can I control the noise level?










      share|improve this question
















      Our Linux systems run logwatch(8) utility by default. On a RedHat/CentOS/SL system, Logwatch is called by the /etc/cron.daily/ cronjob, which then sends a daily email with the results. These emails have a subject like:



      Subject: Logwatch for $HOSTNAME


      The problem is that by default these daily emails are too noisy and contain a lot of superfluous information (HTTP errors, daily disk usage, etc) which are already monitored by other services (Nagios, Cacti, central syslog, etc). For 100 systems, the email load is unbearable. People ignore the emails, which means that we may miss problems which are picked up by logwatch.



      How can I reduce the amount of noise generated by logwatch, but still use logwatch to notify us of significant problems?



      I'll post my own answer below, but I would like to see what others have done.



      Note: I have a similar question regarding FreeBSD, at FreeBSD: periodic(8) is too noisy. How can I control the noise level?







      linux monitoring syslog logwatch






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:14









      Community

      1




      1










      asked Jul 22 '11 at 23:24









      Stefan LasiewskiStefan Lasiewski

      15.3k31108171




      15.3k31108171






















          6 Answers
          6






          active

          oldest

          votes


















          39














          Overall, the available documentation for Logwatch lacks adequate explanation and is often far too vague. I pieced together some useful examples, and have reduced the Logwatch noise by over 95%.



          Here's what I have found.



          Keep in mind that you can find some Logwatch documentation at /usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch, and it contains a few useful examples.





          1. On RHEL/CentOS/SL, the default logwatch configuration is under /usr/share/logwatch/default.conf/logwatch.conf



            These settings can be overriden by placing your local configuration under /etc/logwatch/conf/logwatch.conf. Place the following in that file to tell logwatch to completely ignore services like 'httpd' and the daily disk usage checks:



            # Don't spam about the following Services
            Service = "-http"
            Service = "-zz-disk_space"



          2. Sometimes I don't want to completely disable logwatch for a specific service, I just want to fine tune the results to make them less noisy. /usr/share/logwatch/default.conf/services/*.conf contains the default configuration for the services. These parameters can be overridden by placing your local configuration under /etc/logwatch/conf/services/$SERVICE.conf. Unfortunately, logwatch's ability here is limited, and many of the logwatch executables are full of undocumented Perl. Your choice is to replace the executable with something else, or try to override some settings using /etc/logwatch/conf/services.



            For example, I have a security scanner which runs scans across the network. As the tests run, the security scanner generates many error messages in the application logs. I would like logwatch to ignore errors from my security scanners, but still notify me of attacks from other hosts. This is covered in more detail at Logwatch: Ignore certain IPs for SSH & PAM checks?. To do this, I place the following under /etc/logwatch/conf/services/sshd.conf:



            # Ignore these hosts
            *Remove = 192.168.100.1
            *Remove = X.Y.123.123
            # Ignore these usernames
            *Remove = testuser
            # Ignore other noise. Note that we need to escape the ()
            *Remove = "pam_succeed_if(sshd:auth): error retrieving information about user netscan.*


            "




          3. logwatch also allows you to strip out output from the logwatch emails by placing regular expressions in /etc/logwatch/conf/ignore.conf. HOWTO-Customize-LogWatch says:




            ignore.conf: This file specifies regular expressions that,
            when matched by the output of logwatch, will
            suppress the matching line, regardless of which
            service is being executed.




            However, I haven't had much luck with this. My requirements need a conditional statement, which is something like 'If there are security warnings due to my security scanner, then don't print the output. But if there are security warnings from my security scanner and from some bad guys, then print the useful parts-- The header which says "Failed logins from:", the IPs of the bad hosts, but not the IPs of scanners.'




          4. Nip it at the source (As suggested by @user48838). These messages are being generated by some application, and then Logwatch is happily spewing the results to you. In these cases, you can modify the application to log less.



            This isn't always desirable, because sometimes you want the full logs to be sent somewhere (to a Central syslog server, central IDS server, Splunk, Nagios, etc.), but you don't want logwatch to email you about this from every server, every day.








          share|improve this answer


























          • This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

            – Mike
            Jul 29 '11 at 14:35



















          5














          Yes - logwatch is often too noisy. You already mentioned disabling checks completely.



          If you don`t want to do that you have to prevent certain events to appear.
          For instance - it is not interesting if nagios connects via ssh to a DMZ system. But is is interesting if there are other logins via ssh.



          We use rsyslog instead of ksyslogd (first install rsyslog, then remove ksyslogd).
          With rsyslog you can fine-tune what goes to the logs and what not (e.g. build a expression that drops messages from sshd cointaining "nagios connected"). That way logwatch will report useful information only.



          Another case might be xinetd - I don`t want to get informed about successful connects - this can be configured in xinetd itselv - without disabling the logwatch-check for xinetd.






          share|improve this answer































            3














            As a point of interest I followed option 2 form the answer by Stefan Lasiewski but for my purposes I wanted to only include specific lines rather than exclude all the noise I didn't want.



            I was configuring vsftpd so I created /etc/logwatch/conf/services/vsftpd.conf and instead of using something like *Remove = testuser which removes rows which include the text testuser I used the line *OnlyContains = "testuser" which only returns rows including that text.



            These 2 scripts work very basically by using grep and grep -v.



            The difference being that you can use *Remove as many times as you want but with *OnlyContains you have to use it once if you want something or something else or something else. So for multiple values you do *OnlyContains = "testuser|testuser2|testuser3"






            share|improve this answer

































              1














              Have you considered funneling the email status messages to a listserver, maybe one that can provide digests based on programmable attributes of size and/or duration/age? The approach does not reduce the amount of logging being emailed, but can control the amount of individual emails by batching to reduce the emailing frequency.






              share|improve this answer
























              • I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                – Stefan Lasiewski
                Jul 27 '11 at 18:52






              • 1





                If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                – user48838
                Jul 28 '11 at 1:18



















              0














              I recently needed to quiet down the output from the sshd service. Some of the sections were quite long and could not be controlled by setting the detail level.



              It's not an ideal solution, but I wound up overriding the sshd script by copying it from here: /usr/share/logwatch/scripts/services/sshd to here: /etc/logwatch/scripts/services/sshd



              Of course, you now have to keep up on any updates to that script file, but it does give you very fine control over what is output. Alternatively, I suppose you could pipe the output of logwatch through a tool like awk or sed to strip out what you don't want, but that seemed harder to me.






              share|improve this answer































                0














                I had the same question on UNIX&Linux Stackexchange and here is the answer I that fixed it for me:



                You can tell logwatch to look at 7 days instead of 1 day by changing the Range parameter in your logwatch.conf:



                Range = between -7 days and -1 days


                You can tell logwatch to run weekly instead of daily by moving it from the weekly cron directory to the daily cron directory:



                mv /etc/cron.daily/00logwatch /etc/cron.weekly/


                Thanks to @JeffSchaller





                share








                New contributor




                somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





















                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "2"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f293226%2flinux-logwatch8-is-too-noisy-how-can-i-control-the-noise-level%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  6 Answers
                  6






                  active

                  oldest

                  votes








                  6 Answers
                  6






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  39














                  Overall, the available documentation for Logwatch lacks adequate explanation and is often far too vague. I pieced together some useful examples, and have reduced the Logwatch noise by over 95%.



                  Here's what I have found.



                  Keep in mind that you can find some Logwatch documentation at /usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch, and it contains a few useful examples.





                  1. On RHEL/CentOS/SL, the default logwatch configuration is under /usr/share/logwatch/default.conf/logwatch.conf



                    These settings can be overriden by placing your local configuration under /etc/logwatch/conf/logwatch.conf. Place the following in that file to tell logwatch to completely ignore services like 'httpd' and the daily disk usage checks:



                    # Don't spam about the following Services
                    Service = "-http"
                    Service = "-zz-disk_space"



                  2. Sometimes I don't want to completely disable logwatch for a specific service, I just want to fine tune the results to make them less noisy. /usr/share/logwatch/default.conf/services/*.conf contains the default configuration for the services. These parameters can be overridden by placing your local configuration under /etc/logwatch/conf/services/$SERVICE.conf. Unfortunately, logwatch's ability here is limited, and many of the logwatch executables are full of undocumented Perl. Your choice is to replace the executable with something else, or try to override some settings using /etc/logwatch/conf/services.



                    For example, I have a security scanner which runs scans across the network. As the tests run, the security scanner generates many error messages in the application logs. I would like logwatch to ignore errors from my security scanners, but still notify me of attacks from other hosts. This is covered in more detail at Logwatch: Ignore certain IPs for SSH & PAM checks?. To do this, I place the following under /etc/logwatch/conf/services/sshd.conf:



                    # Ignore these hosts
                    *Remove = 192.168.100.1
                    *Remove = X.Y.123.123
                    # Ignore these usernames
                    *Remove = testuser
                    # Ignore other noise. Note that we need to escape the ()
                    *Remove = "pam_succeed_if(sshd:auth): error retrieving information about user netscan.*


                    "




                  3. logwatch also allows you to strip out output from the logwatch emails by placing regular expressions in /etc/logwatch/conf/ignore.conf. HOWTO-Customize-LogWatch says:




                    ignore.conf: This file specifies regular expressions that,
                    when matched by the output of logwatch, will
                    suppress the matching line, regardless of which
                    service is being executed.




                    However, I haven't had much luck with this. My requirements need a conditional statement, which is something like 'If there are security warnings due to my security scanner, then don't print the output. But if there are security warnings from my security scanner and from some bad guys, then print the useful parts-- The header which says "Failed logins from:", the IPs of the bad hosts, but not the IPs of scanners.'




                  4. Nip it at the source (As suggested by @user48838). These messages are being generated by some application, and then Logwatch is happily spewing the results to you. In these cases, you can modify the application to log less.



                    This isn't always desirable, because sometimes you want the full logs to be sent somewhere (to a Central syslog server, central IDS server, Splunk, Nagios, etc.), but you don't want logwatch to email you about this from every server, every day.








                  share|improve this answer


























                  • This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                    – Mike
                    Jul 29 '11 at 14:35
















                  39














                  Overall, the available documentation for Logwatch lacks adequate explanation and is often far too vague. I pieced together some useful examples, and have reduced the Logwatch noise by over 95%.



                  Here's what I have found.



                  Keep in mind that you can find some Logwatch documentation at /usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch, and it contains a few useful examples.





                  1. On RHEL/CentOS/SL, the default logwatch configuration is under /usr/share/logwatch/default.conf/logwatch.conf



                    These settings can be overriden by placing your local configuration under /etc/logwatch/conf/logwatch.conf. Place the following in that file to tell logwatch to completely ignore services like 'httpd' and the daily disk usage checks:



                    # Don't spam about the following Services
                    Service = "-http"
                    Service = "-zz-disk_space"



                  2. Sometimes I don't want to completely disable logwatch for a specific service, I just want to fine tune the results to make them less noisy. /usr/share/logwatch/default.conf/services/*.conf contains the default configuration for the services. These parameters can be overridden by placing your local configuration under /etc/logwatch/conf/services/$SERVICE.conf. Unfortunately, logwatch's ability here is limited, and many of the logwatch executables are full of undocumented Perl. Your choice is to replace the executable with something else, or try to override some settings using /etc/logwatch/conf/services.



                    For example, I have a security scanner which runs scans across the network. As the tests run, the security scanner generates many error messages in the application logs. I would like logwatch to ignore errors from my security scanners, but still notify me of attacks from other hosts. This is covered in more detail at Logwatch: Ignore certain IPs for SSH & PAM checks?. To do this, I place the following under /etc/logwatch/conf/services/sshd.conf:



                    # Ignore these hosts
                    *Remove = 192.168.100.1
                    *Remove = X.Y.123.123
                    # Ignore these usernames
                    *Remove = testuser
                    # Ignore other noise. Note that we need to escape the ()
                    *Remove = "pam_succeed_if(sshd:auth): error retrieving information about user netscan.*


                    "




                  3. logwatch also allows you to strip out output from the logwatch emails by placing regular expressions in /etc/logwatch/conf/ignore.conf. HOWTO-Customize-LogWatch says:




                    ignore.conf: This file specifies regular expressions that,
                    when matched by the output of logwatch, will
                    suppress the matching line, regardless of which
                    service is being executed.




                    However, I haven't had much luck with this. My requirements need a conditional statement, which is something like 'If there are security warnings due to my security scanner, then don't print the output. But if there are security warnings from my security scanner and from some bad guys, then print the useful parts-- The header which says "Failed logins from:", the IPs of the bad hosts, but not the IPs of scanners.'




                  4. Nip it at the source (As suggested by @user48838). These messages are being generated by some application, and then Logwatch is happily spewing the results to you. In these cases, you can modify the application to log less.



                    This isn't always desirable, because sometimes you want the full logs to be sent somewhere (to a Central syslog server, central IDS server, Splunk, Nagios, etc.), but you don't want logwatch to email you about this from every server, every day.








                  share|improve this answer


























                  • This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                    – Mike
                    Jul 29 '11 at 14:35














                  39












                  39








                  39







                  Overall, the available documentation for Logwatch lacks adequate explanation and is often far too vague. I pieced together some useful examples, and have reduced the Logwatch noise by over 95%.



                  Here's what I have found.



                  Keep in mind that you can find some Logwatch documentation at /usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch, and it contains a few useful examples.





                  1. On RHEL/CentOS/SL, the default logwatch configuration is under /usr/share/logwatch/default.conf/logwatch.conf



                    These settings can be overriden by placing your local configuration under /etc/logwatch/conf/logwatch.conf. Place the following in that file to tell logwatch to completely ignore services like 'httpd' and the daily disk usage checks:



                    # Don't spam about the following Services
                    Service = "-http"
                    Service = "-zz-disk_space"



                  2. Sometimes I don't want to completely disable logwatch for a specific service, I just want to fine tune the results to make them less noisy. /usr/share/logwatch/default.conf/services/*.conf contains the default configuration for the services. These parameters can be overridden by placing your local configuration under /etc/logwatch/conf/services/$SERVICE.conf. Unfortunately, logwatch's ability here is limited, and many of the logwatch executables are full of undocumented Perl. Your choice is to replace the executable with something else, or try to override some settings using /etc/logwatch/conf/services.



                    For example, I have a security scanner which runs scans across the network. As the tests run, the security scanner generates many error messages in the application logs. I would like logwatch to ignore errors from my security scanners, but still notify me of attacks from other hosts. This is covered in more detail at Logwatch: Ignore certain IPs for SSH & PAM checks?. To do this, I place the following under /etc/logwatch/conf/services/sshd.conf:



                    # Ignore these hosts
                    *Remove = 192.168.100.1
                    *Remove = X.Y.123.123
                    # Ignore these usernames
                    *Remove = testuser
                    # Ignore other noise. Note that we need to escape the ()
                    *Remove = "pam_succeed_if(sshd:auth): error retrieving information about user netscan.*


                    "




                  3. logwatch also allows you to strip out output from the logwatch emails by placing regular expressions in /etc/logwatch/conf/ignore.conf. HOWTO-Customize-LogWatch says:




                    ignore.conf: This file specifies regular expressions that,
                    when matched by the output of logwatch, will
                    suppress the matching line, regardless of which
                    service is being executed.




                    However, I haven't had much luck with this. My requirements need a conditional statement, which is something like 'If there are security warnings due to my security scanner, then don't print the output. But if there are security warnings from my security scanner and from some bad guys, then print the useful parts-- The header which says "Failed logins from:", the IPs of the bad hosts, but not the IPs of scanners.'




                  4. Nip it at the source (As suggested by @user48838). These messages are being generated by some application, and then Logwatch is happily spewing the results to you. In these cases, you can modify the application to log less.



                    This isn't always desirable, because sometimes you want the full logs to be sent somewhere (to a Central syslog server, central IDS server, Splunk, Nagios, etc.), but you don't want logwatch to email you about this from every server, every day.








                  share|improve this answer















                  Overall, the available documentation for Logwatch lacks adequate explanation and is often far too vague. I pieced together some useful examples, and have reduced the Logwatch noise by over 95%.



                  Here's what I have found.



                  Keep in mind that you can find some Logwatch documentation at /usr/share/doc/logwatch-*/HOWTO-Customize-LogWatch, and it contains a few useful examples.





                  1. On RHEL/CentOS/SL, the default logwatch configuration is under /usr/share/logwatch/default.conf/logwatch.conf



                    These settings can be overriden by placing your local configuration under /etc/logwatch/conf/logwatch.conf. Place the following in that file to tell logwatch to completely ignore services like 'httpd' and the daily disk usage checks:



                    # Don't spam about the following Services
                    Service = "-http"
                    Service = "-zz-disk_space"



                  2. Sometimes I don't want to completely disable logwatch for a specific service, I just want to fine tune the results to make them less noisy. /usr/share/logwatch/default.conf/services/*.conf contains the default configuration for the services. These parameters can be overridden by placing your local configuration under /etc/logwatch/conf/services/$SERVICE.conf. Unfortunately, logwatch's ability here is limited, and many of the logwatch executables are full of undocumented Perl. Your choice is to replace the executable with something else, or try to override some settings using /etc/logwatch/conf/services.



                    For example, I have a security scanner which runs scans across the network. As the tests run, the security scanner generates many error messages in the application logs. I would like logwatch to ignore errors from my security scanners, but still notify me of attacks from other hosts. This is covered in more detail at Logwatch: Ignore certain IPs for SSH & PAM checks?. To do this, I place the following under /etc/logwatch/conf/services/sshd.conf:



                    # Ignore these hosts
                    *Remove = 192.168.100.1
                    *Remove = X.Y.123.123
                    # Ignore these usernames
                    *Remove = testuser
                    # Ignore other noise. Note that we need to escape the ()
                    *Remove = "pam_succeed_if(sshd:auth): error retrieving information about user netscan.*


                    "




                  3. logwatch also allows you to strip out output from the logwatch emails by placing regular expressions in /etc/logwatch/conf/ignore.conf. HOWTO-Customize-LogWatch says:




                    ignore.conf: This file specifies regular expressions that,
                    when matched by the output of logwatch, will
                    suppress the matching line, regardless of which
                    service is being executed.




                    However, I haven't had much luck with this. My requirements need a conditional statement, which is something like 'If there are security warnings due to my security scanner, then don't print the output. But if there are security warnings from my security scanner and from some bad guys, then print the useful parts-- The header which says "Failed logins from:", the IPs of the bad hosts, but not the IPs of scanners.'




                  4. Nip it at the source (As suggested by @user48838). These messages are being generated by some application, and then Logwatch is happily spewing the results to you. In these cases, you can modify the application to log less.



                    This isn't always desirable, because sometimes you want the full logs to be sent somewhere (to a Central syslog server, central IDS server, Splunk, Nagios, etc.), but you don't want logwatch to email you about this from every server, every day.









                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 13 '17 at 12:14









                  Community

                  1




                  1










                  answered Jul 22 '11 at 23:40









                  Stefan LasiewskiStefan Lasiewski

                  15.3k31108171




                  15.3k31108171













                  • This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                    – Mike
                    Jul 29 '11 at 14:35



















                  • This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                    – Mike
                    Jul 29 '11 at 14:35

















                  This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                  – Mike
                  Jul 29 '11 at 14:35





                  This is exactly what I did, however if I recall correctly, there were some services (I believe something to do with email rejections) that were not being parsed correctly from the logs and were therefore being listed in some sort of "other" category and the entire lines from the logs were being sent by email. This was extremely noisy. I therefore just edited the logwatch source code and added/changed the respective filters and cut probably 20kb per email. This was a few years ago, so I'm sure logwatch has improved since then, but I haven't updated my version in case it hasn't.

                  – Mike
                  Jul 29 '11 at 14:35













                  5














                  Yes - logwatch is often too noisy. You already mentioned disabling checks completely.



                  If you don`t want to do that you have to prevent certain events to appear.
                  For instance - it is not interesting if nagios connects via ssh to a DMZ system. But is is interesting if there are other logins via ssh.



                  We use rsyslog instead of ksyslogd (first install rsyslog, then remove ksyslogd).
                  With rsyslog you can fine-tune what goes to the logs and what not (e.g. build a expression that drops messages from sshd cointaining "nagios connected"). That way logwatch will report useful information only.



                  Another case might be xinetd - I don`t want to get informed about successful connects - this can be configured in xinetd itselv - without disabling the logwatch-check for xinetd.






                  share|improve this answer




























                    5














                    Yes - logwatch is often too noisy. You already mentioned disabling checks completely.



                    If you don`t want to do that you have to prevent certain events to appear.
                    For instance - it is not interesting if nagios connects via ssh to a DMZ system. But is is interesting if there are other logins via ssh.



                    We use rsyslog instead of ksyslogd (first install rsyslog, then remove ksyslogd).
                    With rsyslog you can fine-tune what goes to the logs and what not (e.g. build a expression that drops messages from sshd cointaining "nagios connected"). That way logwatch will report useful information only.



                    Another case might be xinetd - I don`t want to get informed about successful connects - this can be configured in xinetd itselv - without disabling the logwatch-check for xinetd.






                    share|improve this answer


























                      5












                      5








                      5







                      Yes - logwatch is often too noisy. You already mentioned disabling checks completely.



                      If you don`t want to do that you have to prevent certain events to appear.
                      For instance - it is not interesting if nagios connects via ssh to a DMZ system. But is is interesting if there are other logins via ssh.



                      We use rsyslog instead of ksyslogd (first install rsyslog, then remove ksyslogd).
                      With rsyslog you can fine-tune what goes to the logs and what not (e.g. build a expression that drops messages from sshd cointaining "nagios connected"). That way logwatch will report useful information only.



                      Another case might be xinetd - I don`t want to get informed about successful connects - this can be configured in xinetd itselv - without disabling the logwatch-check for xinetd.






                      share|improve this answer













                      Yes - logwatch is often too noisy. You already mentioned disabling checks completely.



                      If you don`t want to do that you have to prevent certain events to appear.
                      For instance - it is not interesting if nagios connects via ssh to a DMZ system. But is is interesting if there are other logins via ssh.



                      We use rsyslog instead of ksyslogd (first install rsyslog, then remove ksyslogd).
                      With rsyslog you can fine-tune what goes to the logs and what not (e.g. build a expression that drops messages from sshd cointaining "nagios connected"). That way logwatch will report useful information only.



                      Another case might be xinetd - I don`t want to get informed about successful connects - this can be configured in xinetd itselv - without disabling the logwatch-check for xinetd.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jul 30 '11 at 19:07









                      NilsNils

                      6,78222364




                      6,78222364























                          3














                          As a point of interest I followed option 2 form the answer by Stefan Lasiewski but for my purposes I wanted to only include specific lines rather than exclude all the noise I didn't want.



                          I was configuring vsftpd so I created /etc/logwatch/conf/services/vsftpd.conf and instead of using something like *Remove = testuser which removes rows which include the text testuser I used the line *OnlyContains = "testuser" which only returns rows including that text.



                          These 2 scripts work very basically by using grep and grep -v.



                          The difference being that you can use *Remove as many times as you want but with *OnlyContains you have to use it once if you want something or something else or something else. So for multiple values you do *OnlyContains = "testuser|testuser2|testuser3"






                          share|improve this answer






























                            3














                            As a point of interest I followed option 2 form the answer by Stefan Lasiewski but for my purposes I wanted to only include specific lines rather than exclude all the noise I didn't want.



                            I was configuring vsftpd so I created /etc/logwatch/conf/services/vsftpd.conf and instead of using something like *Remove = testuser which removes rows which include the text testuser I used the line *OnlyContains = "testuser" which only returns rows including that text.



                            These 2 scripts work very basically by using grep and grep -v.



                            The difference being that you can use *Remove as many times as you want but with *OnlyContains you have to use it once if you want something or something else or something else. So for multiple values you do *OnlyContains = "testuser|testuser2|testuser3"






                            share|improve this answer




























                              3












                              3








                              3







                              As a point of interest I followed option 2 form the answer by Stefan Lasiewski but for my purposes I wanted to only include specific lines rather than exclude all the noise I didn't want.



                              I was configuring vsftpd so I created /etc/logwatch/conf/services/vsftpd.conf and instead of using something like *Remove = testuser which removes rows which include the text testuser I used the line *OnlyContains = "testuser" which only returns rows including that text.



                              These 2 scripts work very basically by using grep and grep -v.



                              The difference being that you can use *Remove as many times as you want but with *OnlyContains you have to use it once if you want something or something else or something else. So for multiple values you do *OnlyContains = "testuser|testuser2|testuser3"






                              share|improve this answer















                              As a point of interest I followed option 2 form the answer by Stefan Lasiewski but for my purposes I wanted to only include specific lines rather than exclude all the noise I didn't want.



                              I was configuring vsftpd so I created /etc/logwatch/conf/services/vsftpd.conf and instead of using something like *Remove = testuser which removes rows which include the text testuser I used the line *OnlyContains = "testuser" which only returns rows including that text.



                              These 2 scripts work very basically by using grep and grep -v.



                              The difference being that you can use *Remove as many times as you want but with *OnlyContains you have to use it once if you want something or something else or something else. So for multiple values you do *OnlyContains = "testuser|testuser2|testuser3"







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Apr 13 '17 at 12:14









                              Community

                              1




                              1










                              answered Nov 26 '12 at 14:18









                              Jacob TomlinsonJacob Tomlinson

                              1632213




                              1632213























                                  1














                                  Have you considered funneling the email status messages to a listserver, maybe one that can provide digests based on programmable attributes of size and/or duration/age? The approach does not reduce the amount of logging being emailed, but can control the amount of individual emails by batching to reduce the emailing frequency.






                                  share|improve this answer
























                                  • I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                    – Stefan Lasiewski
                                    Jul 27 '11 at 18:52






                                  • 1





                                    If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                    – user48838
                                    Jul 28 '11 at 1:18
















                                  1














                                  Have you considered funneling the email status messages to a listserver, maybe one that can provide digests based on programmable attributes of size and/or duration/age? The approach does not reduce the amount of logging being emailed, but can control the amount of individual emails by batching to reduce the emailing frequency.






                                  share|improve this answer
























                                  • I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                    – Stefan Lasiewski
                                    Jul 27 '11 at 18:52






                                  • 1





                                    If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                    – user48838
                                    Jul 28 '11 at 1:18














                                  1












                                  1








                                  1







                                  Have you considered funneling the email status messages to a listserver, maybe one that can provide digests based on programmable attributes of size and/or duration/age? The approach does not reduce the amount of logging being emailed, but can control the amount of individual emails by batching to reduce the emailing frequency.






                                  share|improve this answer













                                  Have you considered funneling the email status messages to a listserver, maybe one that can provide digests based on programmable attributes of size and/or duration/age? The approach does not reduce the amount of logging being emailed, but can control the amount of individual emails by batching to reduce the emailing frequency.







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Jul 27 '11 at 1:06









                                  user48838user48838

                                  7,26921314




                                  7,26921314













                                  • I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                    – Stefan Lasiewski
                                    Jul 27 '11 at 18:52






                                  • 1





                                    If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                    – user48838
                                    Jul 28 '11 at 1:18



















                                  • I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                    – Stefan Lasiewski
                                    Jul 27 '11 at 18:52






                                  • 1





                                    If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                    – user48838
                                    Jul 28 '11 at 1:18

















                                  I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                  – Stefan Lasiewski
                                  Jul 27 '11 at 18:52





                                  I have. We've also considered a syslog-only solution, where we filter out some of the noise. However, for simplicity we wanted to see if it was possible to control this stuff at the source.

                                  – Stefan Lasiewski
                                  Jul 27 '11 at 18:52




                                  1




                                  1





                                  If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                  – user48838
                                  Jul 28 '11 at 1:18





                                  If you are looking at "nipping" it at the source and minimizing any mishaps in doing so, then you might consider limiting the efforts to adjusting the logging levels when available.

                                  – user48838
                                  Jul 28 '11 at 1:18











                                  0














                                  I recently needed to quiet down the output from the sshd service. Some of the sections were quite long and could not be controlled by setting the detail level.



                                  It's not an ideal solution, but I wound up overriding the sshd script by copying it from here: /usr/share/logwatch/scripts/services/sshd to here: /etc/logwatch/scripts/services/sshd



                                  Of course, you now have to keep up on any updates to that script file, but it does give you very fine control over what is output. Alternatively, I suppose you could pipe the output of logwatch through a tool like awk or sed to strip out what you don't want, but that seemed harder to me.






                                  share|improve this answer




























                                    0














                                    I recently needed to quiet down the output from the sshd service. Some of the sections were quite long and could not be controlled by setting the detail level.



                                    It's not an ideal solution, but I wound up overriding the sshd script by copying it from here: /usr/share/logwatch/scripts/services/sshd to here: /etc/logwatch/scripts/services/sshd



                                    Of course, you now have to keep up on any updates to that script file, but it does give you very fine control over what is output. Alternatively, I suppose you could pipe the output of logwatch through a tool like awk or sed to strip out what you don't want, but that seemed harder to me.






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      I recently needed to quiet down the output from the sshd service. Some of the sections were quite long and could not be controlled by setting the detail level.



                                      It's not an ideal solution, but I wound up overriding the sshd script by copying it from here: /usr/share/logwatch/scripts/services/sshd to here: /etc/logwatch/scripts/services/sshd



                                      Of course, you now have to keep up on any updates to that script file, but it does give you very fine control over what is output. Alternatively, I suppose you could pipe the output of logwatch through a tool like awk or sed to strip out what you don't want, but that seemed harder to me.






                                      share|improve this answer













                                      I recently needed to quiet down the output from the sshd service. Some of the sections were quite long and could not be controlled by setting the detail level.



                                      It's not an ideal solution, but I wound up overriding the sshd script by copying it from here: /usr/share/logwatch/scripts/services/sshd to here: /etc/logwatch/scripts/services/sshd



                                      Of course, you now have to keep up on any updates to that script file, but it does give you very fine control over what is output. Alternatively, I suppose you could pipe the output of logwatch through a tool like awk or sed to strip out what you don't want, but that seemed harder to me.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Feb 6 '17 at 21:12









                                      Dominic PDominic P

                                      217212




                                      217212























                                          0














                                          I had the same question on UNIX&Linux Stackexchange and here is the answer I that fixed it for me:



                                          You can tell logwatch to look at 7 days instead of 1 day by changing the Range parameter in your logwatch.conf:



                                          Range = between -7 days and -1 days


                                          You can tell logwatch to run weekly instead of daily by moving it from the weekly cron directory to the daily cron directory:



                                          mv /etc/cron.daily/00logwatch /etc/cron.weekly/


                                          Thanks to @JeffSchaller





                                          share








                                          New contributor




                                          somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                          Check out our Code of Conduct.

























                                            0














                                            I had the same question on UNIX&Linux Stackexchange and here is the answer I that fixed it for me:



                                            You can tell logwatch to look at 7 days instead of 1 day by changing the Range parameter in your logwatch.conf:



                                            Range = between -7 days and -1 days


                                            You can tell logwatch to run weekly instead of daily by moving it from the weekly cron directory to the daily cron directory:



                                            mv /etc/cron.daily/00logwatch /etc/cron.weekly/


                                            Thanks to @JeffSchaller





                                            share








                                            New contributor




                                            somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.























                                              0












                                              0








                                              0







                                              I had the same question on UNIX&Linux Stackexchange and here is the answer I that fixed it for me:



                                              You can tell logwatch to look at 7 days instead of 1 day by changing the Range parameter in your logwatch.conf:



                                              Range = between -7 days and -1 days


                                              You can tell logwatch to run weekly instead of daily by moving it from the weekly cron directory to the daily cron directory:



                                              mv /etc/cron.daily/00logwatch /etc/cron.weekly/


                                              Thanks to @JeffSchaller





                                              share








                                              New contributor




                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.










                                              I had the same question on UNIX&Linux Stackexchange and here is the answer I that fixed it for me:



                                              You can tell logwatch to look at 7 days instead of 1 day by changing the Range parameter in your logwatch.conf:



                                              Range = between -7 days and -1 days


                                              You can tell logwatch to run weekly instead of daily by moving it from the weekly cron directory to the daily cron directory:



                                              mv /etc/cron.daily/00logwatch /etc/cron.weekly/


                                              Thanks to @JeffSchaller






                                              share








                                              New contributor




                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.








                                              share


                                              share






                                              New contributor




                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              answered 1 min ago









                                              somethingSomethingsomethingSomething

                                              1035




                                              1035




                                              New contributor




                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.





                                              New contributor





                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              somethingSomething is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Server Fault!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f293226%2flinux-logwatch8-is-too-noisy-how-can-i-control-the-noise-level%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                                                  Українські прізвища Зміст Історичні відомості |...

                                                  Список ссавців Італії Природоохоронні статуси | Список |...