Would it be appropriate to consult rsyslog.conf?

General support questions
lu3015
Posts: 4
Joined: 2018/01/28 04:34:07

Would it be appropriate to consult rsyslog.conf?

Postby lu3015 » 2018/01/28 04:41:29

Hi,Everybody! work need a log server, has been set up well, LINUX logs can also be passed, but the feeling is not very full, want to consult everybody, there is some place need to modify the configuration of? For example, if I need all the logs to be used in the past log server, and after setting up the log server, will the daily log take up the space of the LINUX server? Thank you for your attention。

Code: Select all

# rsyslog v5 configuration file<br data-filtered="filtered">
<br data-filtered="filtered">
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html<br data-filtered="filtered">
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html<br data-filtered="filtered">
<br data-filtered="filtered">
#### MODULES ####<br data-filtered="filtered">
<br data-filtered="filtered">
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)<br data-filtered="filtered">
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)<br data-filtered="filtered">
#$ModLoad immark  # provides --MARK-- message capability<br data-filtered="filtered">
<br data-filtered="filtered">
# Provides UDP syslog reception<br data-filtered="filtered">
#$ModLoad imudp<br data-filtered="filtered">
#$UDPServerRun 514<br data-filtered="filtered">
<br data-filtered="filtered">
# Provides TCP syslog reception<br data-filtered="filtered">
#$ModLoad imtcp<br data-filtered="filtered">
#$InputTCPServerRun 514<br data-filtered="filtered">
<br data-filtered="filtered">
<br data-filtered="filtered">
#### GLOBAL DIRECTIVES ####<br data-filtered="filtered">
<br data-filtered="filtered">
# Use default timestamp format<br data-filtered="filtered">
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat<br data-filtered="filtered">
<br data-filtered="filtered">
# File syncing capability is disabled by default. This feature is usually not required,<br data-filtered="filtered">
# not useful and an extreme performance hit<br data-filtered="filtered">
#$ActionFileEnableSync on<br data-filtered="filtered">
<br data-filtered="filtered">
# Include all config files in /etc/rsyslog.d/<br data-filtered="filtered">
$IncludeConfig /etc/rsyslog.d/*.conf<br data-filtered="filtered">
<br data-filtered="filtered">
<br data-filtered="filtered">
#### RULES ####<br data-filtered="filtered">
<br data-filtered="filtered">
# Log all kernel messages to the console.<br data-filtered="filtered">
# Logging much else clutters up the screen.<br data-filtered="filtered">
#kern.*                                                 /dev/console<br data-filtered="filtered">
<br data-filtered="filtered">
# Log anything (except mail) of level info or higher.<br data-filtered="filtered">
# Don't log private authentication messages!<br data-filtered="filtered">
*.info;mail.none;authpriv.none;cron.none                /var/log/messages<br data-filtered="filtered">
<br data-filtered="filtered">
# The authpriv file has restricted access.<br data-filtered="filtered">
authpriv.*                                              /var/log/secure<br data-filtered="filtered">
<br data-filtered="filtered">
# Log all the mail messages in one place.<br data-filtered="filtered">
mail.*                                                  -/var/log/maillog<br data-filtered="filtered">
<br data-filtered="filtered">
<br data-filtered="filtered">
# Log cron stuff<br data-filtered="filtered">
cron.*                                                  /var/log/cron<br data-filtered="filtered">
<br data-filtered="filtered">
# Everybody gets emergency messages<br data-filtered="filtered">
*.emerg                                                 *<br data-filtered="filtered">
<br data-filtered="filtered">
# Save news errors of level crit and higher in a special file.<br data-filtered="filtered">
uucp,news.crit                                          /var/log/spooler<br data-filtered="filtered">
<br data-filtered="filtered">
# Save boot messages also to boot.log<br data-filtered="filtered">
local7.*                                                /var/log/boot.log<br data-filtered="filtered">
<br data-filtered="filtered">
<br data-filtered="filtered">
# ### begin forwarding rule ###<br data-filtered="filtered">
# The statement between the begin ... end define a SINGLE forwarding<br data-filtered="filtered">
# rule. They belong together, do NOT split them. If you create multiple<br data-filtered="filtered">
# forwarding rules, duplicate the whole block!<br data-filtered="filtered">
# Remote Logging (we use TCP for reliable delivery)<br data-filtered="filtered">
#<br data-filtered="filtered">
# An on-disk queue is created for this action. If the remote host is<br data-filtered="filtered">
# down, messages are spooled to disk and sent when it is up again.<br data-filtered="filtered">
#$WorkDirectory /var/lib/rsyslog # where to place spool files<br data-filtered="filtered">
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files<br data-filtered="filtered">
#$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)<br data-filtered="filtered">
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown<br data-filtered="filtered">
#$ActionQueueType LinkedList   # run asynchronously<br data-filtered="filtered">
#$ActionResumeRetryCount -1    # infinite retries if host is down<br data-filtered="filtered">
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional<br data-filtered="filtered">
*.* @192.168.0.106:514<br data-filtered="filtered">
# ### end of the forwarding rule ###<br data-filtered="filtered">
<br data-filtered="filtered">
# A template to for higher precision timestamps + severity logging<br data-filtered="filtered">
$template SpiceTmpl,"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"<br data-filtered="filtered">
<br data-filtered="filtered">
:programname, startswith, "spice-vdagent"   /var/log/spice-vdagent.log;SpiceTmpl<br data-filtered="filtered">

User avatar
TrevorH
Forum Moderator
Posts: 21774
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Would it be appropriate to consult rsyslog.conf?

Postby TrevorH » 2018/01/28 17:04:20

I'm pretty sure that rsyslog.conf should not contain HTML...
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lu3015
Posts: 4
Joined: 2018/01/28 04:34:07

Re: Would it be appropriate to consult rsyslog.conf?

Postby lu3015 » 2018/01/29 07:24:41

Thank you for your reply.
1. What kind of scenario does the HTML format generally apply?
2. If I use a third-party log server, will this HTML affect me greatly?
thanks again!

Whoever
Posts: 987
Joined: 2013/09/06 03:12:10

Re: Would it be appropriate to consult rsyslog.conf?

Postby Whoever » 2018/01/29 16:15:48

I think you misunderstand Trevor's comment.

There should not be html in your rsyslog.conf. Your file won't work.

I don't know where you got this file from. Perhaps you copied and pasted from a web page, but you accidentally picked up the html?

lu3015
Posts: 4
Joined: 2018/01/28 04:34:07

Re: Would it be appropriate to consult rsyslog.conf?

Postby lu3015 » 2018/01/30 05:14:09

Whoever wrote:I think you misunderstand Trevor's comment.

There should not be html in your rsyslog.conf. Your file won't work.

I don't know where you got this file from. Perhaps you copied and pasted from a web page, but you accidentally picked up the html?



I am very sorry, this is the file that I sent to another place, and then I copied it, my system is the version of centos 6.5, and I copy the rsyslog.conf file again.


Code: Select all

# rsyslog v5 configuration file

# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html

#### MODULES ####

$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
#$ModLoad immark  # provides --MARK-- message capability

# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514

# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514


#### GLOBAL DIRECTIVES ####

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on

# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf


#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log


# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
#$WorkDirectory /var/lib/rsyslog # where to place spool files
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
#$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
#$ActionQueueType LinkedList   # run asynchronously
#$ActionResumeRetryCount -1    # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
*.* @192.168.0.106:514
# ### end of the forwarding rule ###

# A template to for higher precision timestamps + severity logging
$template SpiceTmpl,"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"

:programname, startswith, "spice-vdagent"   /var/log/spice-vdagent.log;SpiceTmpl

Whoever
Posts: 987
Joined: 2013/09/06 03:12:10

Re: Would it be appropriate to consult rsyslog.conf?

Postby Whoever » 2018/01/30 05:17:34

lu3015 wrote:
I am very sorry, this is the file that I sent to another place, and then I copied it, my system is the version of centos 6.5, and I copy the rsyslog.conf file again.



You need to bring your system up to date. 6.5 is old and horribly insecure.

lu3015
Posts: 4
Joined: 2018/01/28 04:34:07

Re: Would it be appropriate to consult rsyslog.conf?

Postby lu3015 » 2018/01/30 05:32:22

Whoever wrote:
lu3015 wrote:
I am very sorry, this is the file that I sent to another place, and then I copied it, my system is the version of centos 6.5, and I copy the rsyslog.conf file again.



You need to bring your system up to date. 6.5 is old and horribly insecure.



Thank you for reminding me, I know that the formal environment is used in this version, and I am now testing it in the test environment.