Getting Data In

Syslogging via tailing a logfile

NK_1
Path Finder

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

Tags (4)

Linegod
Path Finder

We replace syslog with rsyslog, which can send arbitrary files to syslog.

rsyslog imfile

NK_1
Path Finder

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.

0 Karma

numentajpb
Engager

I'm curious, why not have splunkforwarder just monitor the logfile directly?

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...