rsyslogd only logs from remote servers after enabling UDP:514 on Debian












2















I once wanted rsyslogd (5.8.11) on a Debian 7 container (under OpenVZ) to also receive logs from remote hosts. In that, it works. What no longer works is log messages from the local host. For instance when I type:



$ logger -t shell "Test log message from the command line"


nothing appears in /var/log/messages nor in /var/log/syslog. All I did was add a configuration file to /etc/rsyslog.d, just as follows:



# cat /etc/rsyslog.d/udp.conf
# Enable UDP listening
# http://www.rsyslog.com/tag/tcp/
$ModLoad imudp

# log every host in its own directory
$template RemoteHost,"/var/log/hosts/%HOSTNAME%/%$YEAR%-%$MONTH%-%$DAY%.log"

# Remote Logging
$RuleSet remote
*.* ?RemoteHost

### Listeners

# Bind ruleset to udp listener and activate
$InputUDPServerBindRuleset remote
$UDPServerRun 514


I kept the stock /etc/rsyslogd.conf intact, assuming I didn't have to change anything. Here it is:



# purge /etc/rsyslog.conf    # 'purge' is 'cat with comments removed'
$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog # provides kernel logging support
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$WorkDirectory /var/spool/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
news.crit /var/log/news/news.crit
news.err /var/log/news/news.err
news.notice -/var/log/news/news.notice
*.=debug;
auth,authpriv.none;
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;
auth,authpriv.none;
cron,daemon.none;
mail,news.none -/var/log/messages
*.emerg :omusrmsg:*
daemon.*;mail.*;
news.err;
*.=debug;*.=info;
*.=notice;*.=warn |/dev/xconsole


With this configuration log lines from remote hosts also appear in /var/log/messages and /var/log/syslog (which is not what I want). Local logged lines just no more.



Does anyone know how to just add remote logging while keeping the initial functionalities of rsyslogd?










share|improve this question
















bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    2















    I once wanted rsyslogd (5.8.11) on a Debian 7 container (under OpenVZ) to also receive logs from remote hosts. In that, it works. What no longer works is log messages from the local host. For instance when I type:



    $ logger -t shell "Test log message from the command line"


    nothing appears in /var/log/messages nor in /var/log/syslog. All I did was add a configuration file to /etc/rsyslog.d, just as follows:



    # cat /etc/rsyslog.d/udp.conf
    # Enable UDP listening
    # http://www.rsyslog.com/tag/tcp/
    $ModLoad imudp

    # log every host in its own directory
    $template RemoteHost,"/var/log/hosts/%HOSTNAME%/%$YEAR%-%$MONTH%-%$DAY%.log"

    # Remote Logging
    $RuleSet remote
    *.* ?RemoteHost

    ### Listeners

    # Bind ruleset to udp listener and activate
    $InputUDPServerBindRuleset remote
    $UDPServerRun 514


    I kept the stock /etc/rsyslogd.conf intact, assuming I didn't have to change anything. Here it is:



    # purge /etc/rsyslog.conf    # 'purge' is 'cat with comments removed'
    $ModLoad imuxsock # provides support for local system logging
    $ModLoad imklog # provides kernel logging support
    $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
    $FileOwner root
    $FileGroup adm
    $FileCreateMode 0640
    $DirCreateMode 0755
    $Umask 0022
    $WorkDirectory /var/spool/rsyslog
    $IncludeConfig /etc/rsyslog.d/*.conf
    auth,authpriv.* /var/log/auth.log
    *.*;auth,authpriv.none -/var/log/syslog
    daemon.* -/var/log/daemon.log
    kern.* -/var/log/kern.log
    lpr.* -/var/log/lpr.log
    mail.* -/var/log/mail.log
    user.* -/var/log/user.log
    mail.info -/var/log/mail.info
    mail.warn -/var/log/mail.warn
    mail.err /var/log/mail.err
    news.crit /var/log/news/news.crit
    news.err /var/log/news/news.err
    news.notice -/var/log/news/news.notice
    *.=debug;
    auth,authpriv.none;
    news.none;mail.none -/var/log/debug
    *.=info;*.=notice;*.=warn;
    auth,authpriv.none;
    cron,daemon.none;
    mail,news.none -/var/log/messages
    *.emerg :omusrmsg:*
    daemon.*;mail.*;
    news.err;
    *.=debug;*.=info;
    *.=notice;*.=warn |/dev/xconsole


    With this configuration log lines from remote hosts also appear in /var/log/messages and /var/log/syslog (which is not what I want). Local logged lines just no more.



    Does anyone know how to just add remote logging while keeping the initial functionalities of rsyslogd?










    share|improve this question
















    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2


      0






      I once wanted rsyslogd (5.8.11) on a Debian 7 container (under OpenVZ) to also receive logs from remote hosts. In that, it works. What no longer works is log messages from the local host. For instance when I type:



      $ logger -t shell "Test log message from the command line"


      nothing appears in /var/log/messages nor in /var/log/syslog. All I did was add a configuration file to /etc/rsyslog.d, just as follows:



      # cat /etc/rsyslog.d/udp.conf
      # Enable UDP listening
      # http://www.rsyslog.com/tag/tcp/
      $ModLoad imudp

      # log every host in its own directory
      $template RemoteHost,"/var/log/hosts/%HOSTNAME%/%$YEAR%-%$MONTH%-%$DAY%.log"

      # Remote Logging
      $RuleSet remote
      *.* ?RemoteHost

      ### Listeners

      # Bind ruleset to udp listener and activate
      $InputUDPServerBindRuleset remote
      $UDPServerRun 514


      I kept the stock /etc/rsyslogd.conf intact, assuming I didn't have to change anything. Here it is:



      # purge /etc/rsyslog.conf    # 'purge' is 'cat with comments removed'
      $ModLoad imuxsock # provides support for local system logging
      $ModLoad imklog # provides kernel logging support
      $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
      $FileOwner root
      $FileGroup adm
      $FileCreateMode 0640
      $DirCreateMode 0755
      $Umask 0022
      $WorkDirectory /var/spool/rsyslog
      $IncludeConfig /etc/rsyslog.d/*.conf
      auth,authpriv.* /var/log/auth.log
      *.*;auth,authpriv.none -/var/log/syslog
      daemon.* -/var/log/daemon.log
      kern.* -/var/log/kern.log
      lpr.* -/var/log/lpr.log
      mail.* -/var/log/mail.log
      user.* -/var/log/user.log
      mail.info -/var/log/mail.info
      mail.warn -/var/log/mail.warn
      mail.err /var/log/mail.err
      news.crit /var/log/news/news.crit
      news.err /var/log/news/news.err
      news.notice -/var/log/news/news.notice
      *.=debug;
      auth,authpriv.none;
      news.none;mail.none -/var/log/debug
      *.=info;*.=notice;*.=warn;
      auth,authpriv.none;
      cron,daemon.none;
      mail,news.none -/var/log/messages
      *.emerg :omusrmsg:*
      daemon.*;mail.*;
      news.err;
      *.=debug;*.=info;
      *.=notice;*.=warn |/dev/xconsole


      With this configuration log lines from remote hosts also appear in /var/log/messages and /var/log/syslog (which is not what I want). Local logged lines just no more.



      Does anyone know how to just add remote logging while keeping the initial functionalities of rsyslogd?










      share|improve this question
















      I once wanted rsyslogd (5.8.11) on a Debian 7 container (under OpenVZ) to also receive logs from remote hosts. In that, it works. What no longer works is log messages from the local host. For instance when I type:



      $ logger -t shell "Test log message from the command line"


      nothing appears in /var/log/messages nor in /var/log/syslog. All I did was add a configuration file to /etc/rsyslog.d, just as follows:



      # cat /etc/rsyslog.d/udp.conf
      # Enable UDP listening
      # http://www.rsyslog.com/tag/tcp/
      $ModLoad imudp

      # log every host in its own directory
      $template RemoteHost,"/var/log/hosts/%HOSTNAME%/%$YEAR%-%$MONTH%-%$DAY%.log"

      # Remote Logging
      $RuleSet remote
      *.* ?RemoteHost

      ### Listeners

      # Bind ruleset to udp listener and activate
      $InputUDPServerBindRuleset remote
      $UDPServerRun 514


      I kept the stock /etc/rsyslogd.conf intact, assuming I didn't have to change anything. Here it is:



      # purge /etc/rsyslog.conf    # 'purge' is 'cat with comments removed'
      $ModLoad imuxsock # provides support for local system logging
      $ModLoad imklog # provides kernel logging support
      $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
      $FileOwner root
      $FileGroup adm
      $FileCreateMode 0640
      $DirCreateMode 0755
      $Umask 0022
      $WorkDirectory /var/spool/rsyslog
      $IncludeConfig /etc/rsyslog.d/*.conf
      auth,authpriv.* /var/log/auth.log
      *.*;auth,authpriv.none -/var/log/syslog
      daemon.* -/var/log/daemon.log
      kern.* -/var/log/kern.log
      lpr.* -/var/log/lpr.log
      mail.* -/var/log/mail.log
      user.* -/var/log/user.log
      mail.info -/var/log/mail.info
      mail.warn -/var/log/mail.warn
      mail.err /var/log/mail.err
      news.crit /var/log/news/news.crit
      news.err /var/log/news/news.err
      news.notice -/var/log/news/news.notice
      *.=debug;
      auth,authpriv.none;
      news.none;mail.none -/var/log/debug
      *.=info;*.=notice;*.=warn;
      auth,authpriv.none;
      cron,daemon.none;
      mail,news.none -/var/log/messages
      *.emerg :omusrmsg:*
      daemon.*;mail.*;
      news.err;
      *.=debug;*.=info;
      *.=notice;*.=warn |/dev/xconsole


      With this configuration log lines from remote hosts also appear in /var/log/messages and /var/log/syslog (which is not what I want). Local logged lines just no more.



      Does anyone know how to just add remote logging while keeping the initial functionalities of rsyslogd?







      debian rsyslog






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 6 '14 at 12:39









      slm

      252k70531685




      252k70531685










      asked Nov 6 '14 at 11:15







      user86969












      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I dropped the case. Even though it has a lot more dependencies, I installed syslog-ng, which I know better. This does not answer the question however as it is a last resort work around. I leave the question open to whom knows the answer though.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f166368%2frsyslogd-only-logs-from-remote-servers-after-enabling-udp514-on-debian%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown
























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I dropped the case. Even though it has a lot more dependencies, I installed syslog-ng, which I know better. This does not answer the question however as it is a last resort work around. I leave the question open to whom knows the answer though.






            share|improve this answer




























              0














              I dropped the case. Even though it has a lot more dependencies, I installed syslog-ng, which I know better. This does not answer the question however as it is a last resort work around. I leave the question open to whom knows the answer though.






              share|improve this answer


























                0












                0








                0







                I dropped the case. Even though it has a lot more dependencies, I installed syslog-ng, which I know better. This does not answer the question however as it is a last resort work around. I leave the question open to whom knows the answer though.






                share|improve this answer













                I dropped the case. Even though it has a lot more dependencies, I installed syslog-ng, which I know better. This does not answer the question however as it is a last resort work around. I leave the question open to whom knows the answer though.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 '14 at 14:35







                user86969





































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f166368%2frsyslogd-only-logs-from-remote-servers-after-enabling-udp514-on-debian%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

                    Loup dans la culture

                    How to solve the problem of ntp “Unable to contact time server” from KDE?

                    ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux