This is quite lengthy but hopefully it proves to be useful.
In order to better troubleshoot this issue I set-up a simplified scenario.
Everything is as-is from the test machine.
I have a symbolic link /opt/rsyslog that points to /opt/rsyslog-3.18.3-Test3
The binary is located in /opt/rsyslog/sbin/rsyslogd Permissions: 755 Owner: root Group: root
The modules are located in /opt/rsyslog/lib/rsyslog Permissions: 755 Owner: root Group: root
The configuration file is /etc/rsyslog.conf Permissions: 600 Owner: root Group: root
rsyslog.conf contents
- Code: Select all
$ModLoad imfile
$ModLoad imuxsock
$ModLoad imklog
$ModLoad ommysql
$EscapeControlCharactersOnReceive on
$FileOwner root
$FileGroup root
$FileCreateMode 0600
$WorkDirectory /opt/rsyslog/data
$InputFileName /var/log/sample.err
$InputFileTag sample-err
$InputFileStateFile sample.err.state
$InputFileSeverity err
$InputFileFacility local3
$InputRunFileMonitor
$MainMsgQueueType LinkedList
$MainMsgQueueSize 20000
$MainMsgQueueFileName spool
$MainMsgQueueMaxDiskSpace 200M
$MainMsgQueueWorkerThreadMinimumMessages 2500
$MainMsgQueueWorkerThreads 8
$MainMsgQueueWorkerTimeoutThreadShutdown 10000
$MainMsgQueueSaveOnShutdown on
$template my-rsyslog-schema,"insert into messages(hostname, sent, received_by_rsyslog, process, facility, severity, message) values ('%hostname%', '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', '%programname%', '%syslogfacility-text%', '%syslogseverity-text%', '%msg%')",sql
*.* :ommysql:127.0.0.1,rsyslog,rsyslog_user,password;my-rsyslog-schema
The sample text file is /var/log/sample.err Permissions: 600 Owner: root Group: root
sample.err contents
- Code: Select all
Error Line 1
Error Line 2
Error Line 3
Error Line 4
Error Line 5
Error Line 6
Error Line 7
Error Line 8
Error Line 9
Error Line 10
I then performed these steps
1)
The database is running and RSyslog is stopped.
The database table is empty.
2)
Start RSyslog with
/opt/rsyslog/sbin/rsyslogd -c3 -dn > /opt/debug.txt
3)
Wait roughly 10 seconds and then check /opt/rsyslog/data on another console.
It's empty, I expected to find sample.err.state there.
4)
After another 10 seconds, stop RSyslog with Ctrl-c.
/opt/rsyslog/data is still empty.
The contents of debug.txt can be found at
http://pastebin.ca/1168071A screenshot of the database's contents can be found at
http://imagebin.ca/view/m1zhi_9s.html5)
I start RSyslog again with
/opt/rsyslog/sbin/rsyslogd -c3 -dn > /opt/debug2.txt
6)
I wait roughly 10 seconds and then check /opt/rsyslog/data on another console.
It's empty.
7)
After another 10 seconds I stop RSyslog with Ctrl-c.
/opt/rsyslog/data is still empty.
The contents of debug2.txt can be found at
http://pastebin.ca/1168090A screenshot of the database's contents at this point can be found at
http://imagebin.ca/view/vwkQUYvC.htmlAs you can see the lines have been entered again in the database.
I hope this helps shedding some light on this issue.
Let me know if I have to do more testing, thank you.