From 3ae01af3201cbd51e36c03ab8baf28f273fcca4f Mon Sep 17 00:00:00 2001 From: Bill Glick Date: Mon, 2 Dec 2024 17:28:38 -0600 Subject: [PATCH] SVCPLAN-6652: Add syslog class to track specific GitLab logs via syslog --- manifests/syslog.pp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/manifests/syslog.pp b/manifests/syslog.pp index a5bcbbd..a6a6109 100644 --- a/manifests/syslog.pp +++ b/manifests/syslog.pp @@ -5,40 +5,39 @@ class profile_gitlab::syslog { include rsyslog - rsyslog::component::module { 'imload': - priority => $rsyslog::module_load_priority, + $rsyslog_default_params = { target => '75_gitlab.conf', confdir => $rsyslog::confdir, - #config = {}, - #type = 'external', - #format = '<%= $content %>', } - $rsyslog_input_params = { - confdir => $rsyslog::confdir, - priority => $rsyslog::input_priority, - target => '75_gitlab.conf', - type => 'imfile', + # Define the rsyslog module + rsyslog::component::module { 'imfile': + priority => $rsyslog::module_load_priority, + * => $rsyslog_default_params, } - # Define the rsyslog configuration + # Define the rsyslog inputs rsyslog::component::input { 'gitlab-access': - config => { + config => { facility => 'local0', file => '/var/log/gitlab/nginx/gitlab_access.log', severity => 'info', + tag => 'gitlab-access', }, - tag => 'gitlab-access', - * => $rsyslog_input_params, + priority => $rsyslog::input_priority, + type => 'imfile', + * => $rsyslog_default_params, } rsyslog::component::input { 'gitlab-shell': - config => { + config => { facility => 'local0', file => '/var/log/gitlab/gitlab-shell/gitlab-shell.log', severity => 'info', + tag => 'gitlab-shell', }, - tag => 'gitlab-shell', - * => $rsyslog_input_params, + priority => $rsyslog::input_priority, + type => 'imfile', + * => $rsyslog_default_params, } }