1. # rsyslog configuration file
    2. # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
    3. # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
    4. #### MODULES ####
    5. # The imjournal module bellow is now used as a message source instead of imuxsock.
    6. $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
    7. $ModLoad imjournal # provides access to the systemd journal
    8. #$ModLoad imklog # reads kernel messages (the same are read from journald)
    9. #$ModLoad immark # provides --MARK-- message capability
    10. # Provides UDP syslog reception
    11. $ModLoad imudp
    12. $UDPServerRun 514
    13. # Provides TCP syslog reception
    14. $ModLoad imtcp
    15. $InputTCPServerRun 514
    16. #### GLOBAL DIRECTIVES ####
    17. # Where to place auxiliary files
    18. $WorkDirectory /var/lib/rsyslog
    19. # Use default timestamp format
    20. $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
    21. $template Remote,"/data/logs/%fromhost-ip%/%fromhost-ip%_%$YEAR%-%$MONTH%-%$DAY%.log"
    22. :fromhost-ip, !isequal, "127.0.0.1" ?Remote
    23. # File syncing capability is disabled by default. This feature is usually not required,
    24. # not useful and an extreme performance hit
    25. #$ActionFileEnableSync on
    26. # Include all config files in /etc/rsyslog.d/
    27. $IncludeConfig /etc/rsyslog.d/*.conf
    28. # Turn off message reception via local log socket;
    29. # local messages are retrieved through imjournal now.
    30. $OmitLocalLogging on
    31. # File to store the position in the journal
    32. $IMJournalStateFile imjournal.state
    33. #### RULES ####
    34. # Log all kernel messages to the console.
    35. # Logging much else clutters up the screen.
    36. #kern.* /dev/console
    37. # Log anything (except mail) of level info or higher.
    38. # Don't log private authentication messages!
    39. *.info;mail.none;authpriv.none;cron.none /var/log/messages
    40. # The authpriv file has restricted access.
    41. authpriv.* /var/log/secure
    42. # Log all the mail messages in one place.
    43. mail.* -/var/log/maillog
    44. # Log cron stuff
    45. cron.* /var/log/cron
    46. # Everybody gets emergency messages
    47. *.emerg :omusrmsg:*
    48. # Save news errors of level crit and higher in a special file.
    49. uucp,news.crit /var/log/spooler
    50. # Save boot messages also to boot.log
    51. local7.* /var/log/boot.log
    52. ## Cisco asa log
    53. #$template myformat,"%FROMHOST-IP%: %msg:2:$%\n"
    54. #$template cisco,"/audit/cisco-asa/%FROMHOST-IP%.log"
    55. #local4.* ?cisco;myformat
    56. # ### begin forwarding rule ###
    57. # The statement between the begin ... end define a SINGLE forwarding
    58. # rule. They belong together, do NOT split them. If you create multiple
    59. # forwarding rules, duplicate the whole block!
    60. # Remote Logging (we use TCP for reliable delivery)
    61. #
    62. #
    63. # An on-disk queue is created for this action. If the remote host is
    64. # down, messages are spooled to disk and sent when it is up again.
    65. #$ActionQueueFileName fwdRule1 # unique name prefix for spool files
    66. #$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
    67. #$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
    68. #$ActionQueueType LinkedList # run asynchronously
    69. #$ActionResumeRetryCount -1 # infinite retries if host is down
    70. # remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
    71. *.* /audit/audit.log
    72. # ### end of the forwarding rule ###