Created
June 28, 2010 16:49
-
-
Save elubow/456080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'erb' | |
rsyslog_block = %{# | |
# <%= virtual_host %> | |
# | |
$InputFileName /var/log/httpd/<%= virtual_host %>-error.log | |
$InputFileTag <%= virtual_host %>_error | |
$InputFileStateFile stat-<%= virtual_host %>-error.log | |
$InputFileSeverity info | |
$InputFileFacility local5 | |
$InputRunFileMonitor | |
$InputFileName /var/log/httpd/<%= virtual_host %>-access.log | |
$InputFileTag <%= virtual_host %>_access | |
$InputFileStateFile stat-<%= virtual_host %>-access.log | |
$InputFileSeverity info | |
$InputFileFacility local6 | |
$InputRunFileMonitor | |
} | |
# Replace with your domains | |
%w{ | |
blog.myhost.com | |
img.myhost.com | |
css.myhost.com | |
rss.myhost.com | |
search.myhost.com | |
www.myhost.com | |
}.each { |virtual_host| puts ERB.new( rsyslog_block ).result(binding) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment