I have to send data from rsyslog in a format like this Eg:
fac:kern HELLO pri:info HELLO May 5 14:06:31 nitish-VirtualBox kernel: Kernel logging (proc) stopped.
So i created a new conf file called "my.conf"
in /etc/rsyslog.d/
and added the following lines in it
$template myFormat,"fac:%syslogfacility-text% HELLO pri:%syslogpriority-text% HELLO %timegenerated% %msg%\n"
*.* /home/user/log.txt;myFormat
so that i can strip this log message in my java application to get facility name,priority name and rest of the message.Here string "HELLO" acts as a filter element.
i can create templates in rsyslog and send incoming syslog messages in this format to log.txt. But now i have to send log messages from sysklogd(not syslog-ng and not rsyslog) in the same format but sysklogd does not support templates.So is there a way to change the log message format in sysklogd