1
0
mirror of https://github.com/krislamo/graylog_demo synced 2024-12-16 06:50:35 +00:00

Give td-agent permission to /var/log

This commit is contained in:
Kris Lamoureux 2020-03-05 11:03:52 -05:00
parent 15f1d8bb32
commit 550aaafa4f
Signed by: kris
GPG Key ID: A30022791E1719A4
2 changed files with 13 additions and 10 deletions

21
Vagrantfile vendored
View File

@ -33,15 +33,6 @@ Vagrant.configure("2") do |config|
systemctl -q enable docker systemctl -q enable docker
usermod -aG docker vagrant usermod -aG docker vagrant
# Install td-agent
cp --update /vagrant/td-agent.repo /etc/yum.repos.d/
yum check-update
yum install -y td-agent
td-agent-gem install fluent-plugin-gelf-hs gelf
cp /vagrant/td-agent.conf /etc/td-agent/td-agent.conf
systemctl restart td-agent
systemctl -q enable td-agent
# Convenience # Convenience
yum install -y vim yum install -y vim
@ -59,6 +50,18 @@ Vagrant.configure("2") do |config|
systemctl start rsyslog systemctl start rsyslog
systemctl -q enable rsyslog systemctl -q enable rsyslog
# Install td-agent
cp /vagrant/td-agent.repo /etc/yum.repos.d/
yum check-update
yum install -y td-agent
td-agent-gem install fluent-plugin-gelf-hs gelf
cp /vagrant/td-agent.conf /etc/td-agent/td-agent.conf
mkdir /var/log/containers
chown -R td-agent:td-agent /var/log/containers
chmod -R 755 /var/log
systemctl restart td-agent
systemctl -q enable td-agent
# Add rsyslog forwarding option if it does not exist # Add rsyslog forwarding option if it does not exist
if ! grep -q "127.0.0.1:5140" /etc/rsyslog.conf; then if ! grep -q "127.0.0.1:5140" /etc/rsyslog.conf; then
echo "*.* @127.0.0.1:5140" >> /etc/rsyslog.conf echo "*.* @127.0.0.1:5140" >> /etc/rsyslog.conf

View File

@ -12,7 +12,7 @@
<source> <source>
@type tail @type tail
path /var/log/httpd/access_log path /var/log/httpd/access_log
pos_file /var/log/httpd/access_log.pos pos_file /var/log/td-agent/access_log.pos
tag httpd.access tag httpd.access
<parse> <parse>
@type apache2 @type apache2