On Mon, 21 Jul 2014, Muhammad Asif Ihsan wrote:

I'm not even seeing test.py in this output

This presentation, http://www.rsyslog.com/writing-external-output-plugins-
for-rsyslog/, says that below version 8 support c files and above 8 provide
support for java, perl and python. So I replaced my python file with c file
named as newtest.c

remember that rsyslog isn't going to try and compile your file, you would need to compile your C program and use the resulting binary in the rsyslog configuration

digging a bit I see ssh_logger.py mentioned, is the config the same except for the name?

Yes, they borh are same except for the name.

but without any logs that would be delivered to this output, rsyslog will never start it

I also send logs after restarting syslog through rsyslogd -dn  command.

The thing is that we don't see that in the debug file you are providing

the .py file should have a #! line, you don't show that in the pasted file
below

As I am running 7.6.3 version so replaced it with my newtest.c
 see this http://pastebin.com/zuxVrnhY, and search for newtest.c, but it is
doing nothing see, if there is any problem in my c file. its code is given
below:

FILE *f;
f = fopen("/opt/myfile", "a");
fprintf(f, "%c\n", "paki");
fclose(f);

Try making your program be

#!/bin/bash
echo "$@" >/var/log/someplace

make sure this is executable

After you get this simple example working, then we can move to having the thing being run be in a different language. Rsyslog doesn't care what language it's written in, it just asks the OS to execute the filename that you give it. If the OS can't do that, it's not going to work. Unix Operating systems don't look at the filename/extension to figure out how to run the file, they look to see if the first line is #! for a script, or expect it to be a compiled binary.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to