<commit_before># This file was generated by Chef

<% if @monitor_files %>
$ModLoad imfile

	<% node['loggly']['log_files'].each do |logfile| %>
$InputFileName <%= logfile['filename'] %>
$InputFileTag <%= logfile['tag'] %>:
$InputFileStateFile <%= logfile['statefile'] %>
$InputRunFileMonitor
	<% end %>

  <% node['loggly']['log_dirs'].each do |logdir| %>
    <% Dir.foreach(logdir['directory']) do |filename| %>
      <% if filename =~ /[\w\.-_\d]+\.log$/ %>
$InputFileName <%= "#{logdir['directory']}/#{filename}" %>
$InputFileTag <%= logdir['tag'] %>:
$InputFileStateFile state-<%= filename %>
$InputRunFileMonitor

      <% end %>
    <% end %>
  <% end %>

$InputFilePollInterval <%= node['loggly']['rsyslog']['input_file_poll_interval'] %>
<% end %>

$template LogglyFormat,"<%%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [<%= @token %>@4<PASSWORD>8 <%= @tags %>] %msg%\n"

<% if node['loggly']['tls']['enabled'] %><commit_msg>Fix formatting of the conf file when no files are provided<commit_after># This file was generated by Chef

<% if @monitor_files -%>
$ModLoad imfile

	<% node['loggly']['log_files'].each do |logfile| %>
$InputFileName <%= logfile['filename'] %>
$InputFileTag <%= logfile['tag'] %>:
$InputFileStateFile <%= logfile['statefile'] %>
$InputRunFileMonitor
	<% end %>

  <% node['loggly']['log_dirs'].each do |logdir| %>
    <% Dir.foreach(logdir['directory']) do |filename| %>
      <% if filename =~ /[\w\.-_\d]+\.log$/ %>
$InputFileName <%= "#{logdir['directory']}/#{filename}" %>
$InputFileTag <%= logdir['tag'] %>:
$InputFileStateFile state-<%= filename %>
$InputRunFileMonitor

      <% end %>
    <% end %>
  <% end %>

$InputFilePollInterval <%= node['loggly']['rsyslog']['input_file_poll_interval'] %>

<% end -%>
$template LogglyFormat,"<%%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [<%= @token %>@4<PASSWORD>8 <%= @tags %>] %msg%\n"

<% if node['loggly']['tls']['enabled'] %>
{'fraction_non_alphanumeric': 0.2433915211970075, 'fraction_numerical': 0.0059850374064837905, 'mean_word_length': 5.534201954397394, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, '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': '4320710', 'n_tokens_mistral': 781, 'n_tokens_neox': 676, 'n_words': 126}