Last active
October 21, 2017 07:18
-
-
Save enonethreezed/124f30a3f42d77301e8b49a7e202482d to your computer and use it in GitHub Desktop.
Change rsyslog of Ubuntu 14 to last package from Adiscom. Create a pipe using ompipe plugin.
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
sudo add-apt-repository ppa:adiscon/v8-stable | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade # Force rsyslog update | |
# On a new terminal | |
logger Testing syslog interaction with new version && sudo tail -c 10000 /var/log/syslog | |
# Use the ompipe plugin to redirect everything and begin our tests, adding this to the end of file: | |
## rsyslog to fifo | |
*.* action(type="ompipe" Pipe="/var/log/rsyslog.pipe") | |
# Create the fifo and testing if everything is fine: | |
sudo mkfifo /var/log/rsyslog.pipe | |
sudo chown syslog. -v /var/log/rsyslog.pipe | |
ls -lZ /var/log/rsyslog.pipe | |
file /var/log/rsyslog.pipe | |
# Reload service: | |
sudo service rsyslog reload | |
# It's time to test reading from the pipe using a bash script avoiding cat: | |
#!/bin/bash | |
# Just read to test | |
while read line | |
do | |
echo $line | |
done << /var/log/rsyslog.pipe | |
# sudo grep -P '^(?=.*named)(?=.*cache)(?=.*denied)' /var/log/syslog | awk '{ print $7 }' | awk -F \# '{ print $1}' | sort | uniq -u | |
sudo grep -P '^(?=.*named)(?=.*cache)(?=.*denied)' /var/log/syslog | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment