In my system i am having rsyslog daemon running. I tried to configure syslog.conf to sent all authentication mail to a particular file using the line
its working. Now i want to send these messages to a process. The process will be ready to capture the logs. previously i was using syslogd daemon. In that i was able to send the log using the line below
auth.*;authpriv.* |exec /usr/bin/read.exe
But the same is not working with rsyslogd. Do any one have any clue how to do this?
UPDATE: Particularly this issue happens with python scripts ex code:
#!/usr/local/bin/python import sys import fcntl, os message = sys.stdin.readline() # Read what's waiting, in one go if not message: print "nothing in message\n" fd = open('/tmp/testrsyslogomoutput1.txt', 'a') fd.write("Receiving log message : \n%s\n" % (message)) fd.close()
This python code i want to invoke through rsyslog.