Monitor a log file and execute commands based on patterns
#!/bin/sh tail -fn0 /var/log/file.log | while read line ; do ย ย ย ย echo “$line” | grep “pattern” ย ย ย ย if [… Read More »Monitor a log file and execute commands based on patterns
#!/bin/sh tail -fn0 /var/log/file.log | while read line ; do ย ย ย ย echo “$line” | grep “pattern” ย ย ย ย if [… Read More »Monitor a log file and execute commands based on patterns
#!/bin/sh append=“”; tail -F /opt/log/audit/audit.log | sed -u -e ‘s/^M//g’ -e ‘/^$/d’ -e ‘s/ *$//g’ -e ‘s/^ *//g’ -e ‘s/ +/ /g’ย | while read… Read More »Watch log file and send logs to syslog