Ideally, we'd like to modify the application to syslog directly for indexing by Splunk.
In the meantime, is there any adverse effect to tailing the last line of the log, and invoking logger to syslog?
#!/bin/bash
tail -n1 -F -q MyLogFile.log | \
while read -r line ; do
# send to local syslog
logger -t MyAppTag -p local1.info `echo "$line"`
done
We replace syslog with rsyslog, which can send arbitrary files to syslog.
That would involve installing the forwarder on every host we use. Our hosts are already set up to forward local syslogged events to be indexed by Splunk, and I am trying to leverage that mechanism.
I'm curious, why not have splunkforwarder just monitor the logfile directly?