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:
parent
15f1d8bb32
commit
550aaafa4f
21
Vagrantfile
vendored
21
Vagrantfile
vendored
@ -33,15 +33,6 @@ Vagrant.configure("2") do |config|
|
||||
systemctl -q enable docker
|
||||
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
|
||||
yum install -y vim
|
||||
|
||||
@ -59,6 +50,18 @@ Vagrant.configure("2") do |config|
|
||||
systemctl start 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
|
||||
if ! grep -q "127.0.0.1:5140" /etc/rsyslog.conf; then
|
||||
echo "*.* @127.0.0.1:5140" >> /etc/rsyslog.conf
|
||||
|
@ -12,7 +12,7 @@
|
||||
<source>
|
||||
@type tail
|
||||
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
|
||||
<parse>
|
||||
@type apache2
|
||||
|
Loading…
Reference in New Issue
Block a user