configuração do usuário do rsyslog não funciona

1

Estou tentando fornecer a opção ao usuário para adicionar sua opção de configuração de usuário para o rsyslog. O rsyslog padrão está funcionando bem para mim.

A configuração principal ou padrão do arquivo rsyslog é semelhante a:

# if you experience problems, check
# http://www.rsyslog.com/troubleshoot for assistance

# rsyslog v3: load input modules
# If you do not load inputs, nothing happens!
# You may need to set the module load path if modules are not found.
#
# Ported from debian's sysklogd.conf

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

# Enable traditional timestamp format                                                                                                                                                                            
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

#
# Set the default permissions
#
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022

## Include custom config fragments
##
$IncludeConfig /usr/local/etc/rsyslog.d/*.conf
$IncludeConfig /tmp/rsyslog.d/*.conf

# Default logs
auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
cron.*                          /var/log/cron.log
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

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

# Logging for INN news system
#
news.crit                       /var/log/news.crit
news.err                        /var/log/news.err
news.notice                     -/var/log/news.notice

#
# Some 'catch-all' logfiles.
#
 *.=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

 #
 # Emergencies are sent to everybody logged in.
 #
 *.emerg                         :omusrmsg:*

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

Meu arquivo de filtro rsyslog é parecido com o abaixo e está localizado em /etc/rsyslog.ab.conf

##############################################################################
  ##                                                                            
  #
  ## Security relevant user authentication tags                                 
  #
  ##                                                                            
  #
  ## ALS, ALF                                                                   
  #

  ###############################################################################
  #$template ALS_sshd,"<38>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% 
  %PROCID% %MSGID% %STRUCTURED-DATA% ALS : %msg%\n"
  #if $programname contains 'sshd' and $msg contains 'Accepted password' then 
  /var/log/sedl.log;ALS_sshd
  #if $programname contains 'sshd' and $msg contains 'Accepted password' then 
  @128.224.124.147;ALS_sshd

  #$template ALS_login,"<38>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% 
  %PROCID% %MSGID% %STRUCTURED-DATA% ALS : %msg%\n"
  #if $programname contains 'login' and $msg contains 'login' then 
  /var/log/sedl.log;ALS_login
  #if $programname contains 'login' and $msg contains 'login' then 
  @128.224.124.147;ALS_login

  $template ALF_sshdPW,"<38>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% 
  %PROCID% %MSGID% %STRUCTURED-DATA% ALF : %msg%\n"
  if $programname contains 'sshd' and $msg contains 'Failed password' then 
  /var/log/sedl.log;ALF_sshdPW
  if $programname contains 'sshd' and $msg contains 'Failed password' then 
  @128.224.124.147;ALF_sshdPW

se eu descomentar o "if's" do exemplo acima, ele funciona bem, no entanto, se eu mover esse arquivo para /usr/local/etc/rsyslog.d/*.conf com "se" ele não funcionar. Mesmo que eu tenha adicionado o $ IncludeConfig /usr/local/etc/rsyslog.d/*.conf , que deve fazê-lo funcionar. No entanto, ele só funciona em / etc / * conf não para /usr/local/etc/rsyslog.d/*conf. Eu tentei usar $ ResetConfigVariables mas não funcionou.

Embora eu veja a entrada de log no syslog.

Eu rsyslog versão que estou usando é 7.4.4. Quaisquer ponteiros seriam apreciados. Obrigado

    
por JNI_OnLoad 24.07.2018 / 10:20

0 respostas