Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using more than one config file in /etc/rsyslog.d/ #196

Open
nilo72 opened this issue Apr 8, 2022 · 2 comments
Open

Using more than one config file in /etc/rsyslog.d/ #196

nilo72 opened this issue Apr 8, 2022 · 2 comments

Comments

@nilo72
Copy link

nilo72 commented Apr 8, 2022

As I understand it right everything is written to the rsyslog:target_file.

Do you plan a feature to split a rsyslog configuration into more than one config file?

@bschonec
Copy link
Contributor

bschonec commented Apr 21, 2022

Does #98 address your question?

rsyslog::config::actions:
  all_logs_to_siem:
    type: omfwd
    facility: "*.*"
    target: siem.conf       # Create this configuration in its own file.
    config:    
      target: "siem.example.com"
      protocol: udp

[root@rhel8 rsyslog.d]# ls -l /etc/rsyslog.d/siem.conf 
-rw-r--r--. 1 root root 127 Jun 22 08:21 /etc/rsyslog.d/siem.conf

@traldi
Copy link

traldi commented Aug 9, 2023

Hi,
I have a similar question:
I would like to put a general config in 50_rsyslog.conf with standard module and some prifilts and actions. (I did this)
I have another puppet module for example ngnix.pp which I would like to use a different file like /etc/rsyslog.d/60_ngnix.conf with for example a local logger like:

class { 'rsyslog::config':

'expression_filters' => {

'complex_filer' => {
   'conditionals' => {
      'conntrack' => {
        'expression' => 'prifilt("local1.*")'
        'tasks' => [
          'action' => {
           'type' => 'omfile',
          'config' => {'file' => '/var/log/ngnix.log'}
           }
         ]
      }
   }
 }

}
}

So I would have in all hosts the 50_rsyslog.conf and only in few host also the file /etc/rsyslog.d/60_ngnix.conf
with this content:
if prifilt("local1.*") then { action(type="omfile" file="/var/log/ngnix.log") }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants