<commit_before># File is managed by puppet

<% # Common header across all templates -%>
<%= scope.function_template(['rsyslog/server/_default-header.conf.erb']) %>

# Log files are stored in directories matching the hostname
<% if scope.lookupvar('rsyslog::server::enable_onefile') == false -%>

# Templates
$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>auth.log"
$Template dynSyslog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>syslog"
$Template dynCronLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>cron.log"
$Template dynDaemonLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>daemon.log"
$Template dynKernLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>kern.log"
$Template dynUserLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>user.log"
$Template dynMailLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>mail.log"
$Template dynDebug,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>debug"
$Template dynMessages,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>messages"

# Rules
auth,authpriv.*         ?dynAuthLog
*.*;auth,authpriv.none,mail.none,cron.none      -?dynSyslog
cron.*              ?dynCronLog
daemon.*            -?dynDaemonLog
kern.*              -?dynKernLog
mail.*              -?dynMailLog
user.*              -?dynUserLog
*.=info;*.=notice;*.=warn;\
    auth.none,authpriv.none;\
    cron.none,daemon.none;\
    mail.none,news.none     -?dynMessages
<% else -%>
# Template
$Template dynAllMessages,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>messages"

# Rules
*.*                 -?dynAllMessages
<% end -%>

<% # Common footer across all templates -%>
<%= scope.function_template(['rsyslog/server/_default-footer.conf.erb']) %><commit_msg>Add a timestamp to the server logfiles<commit_after># File is managed by puppet

<% # Common header across all templates -%>
<%= scope.function_template(['rsyslog/server/_default-header.conf.erb']) %>

# Log files are stored in directories matching the hostname
<% if scope.lookupvar('rsyslog::server::enable_onefile') == false -%>

# Templates
$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>auth-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynSyslog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>syslog-%$YEAR%-%$MONTH%-%$DAY%"
$Template dynCronLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>cron-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynDaemonLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>daemon-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynKernLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>kern-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynUserLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>user-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynMailLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>mail-%$YEAR%-%$MONTH%-%$DAY%.log"
$Template dynDebug,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>debug-%$YEAR%-%$MONTH%-%$DAY%"
$Template dynMessages,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>messages-%$YEAR%-%$MONTH%-%$DAY%"

# Rules
auth,authpriv.*         ?dynAuthLog
*.*;auth,authpriv.none,mail.none,cron.none      -?dynSyslog
cron.*              ?dynCronLog
daemon.*            -?dynDaemonLog
kern.*              -?dynKernLog
mail.*              -?dynMailLog
user.*              -?dynUserLog
*.=info;*.=notice;*.=warn;\
    auth.none,authpriv.none;\
    cron.none,daemon.none;\
    mail.none,news.none     -?dynMessages
<% else -%>
# Template
$Template dynAllMessages,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%hostname%<%= scope.lookupvar('rsyslog::server::logpath') -%>messages-%$YEAR%-%$MONTH%-%$DAY%"

# Rules
*.*                 -?dynAllMessages
<% end -%>

<% # Common footer across all templates -%>
<%= scope.function_template(['rsyslog/server/_default-footer.conf.erb']) %>
{'fraction_non_alphanumeric': 0.22794846382556988, 'fraction_numerical': 0.0, 'mean_word_length': 5.921810699588478, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2536893', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1799, 'n_words': 238}