Am I understanding correctly that you want to write some of the data from named pipe to an external log? Since SEC is already reading from the pipe, it's a bad idea to start another process that reads the same pipe, since reading removes data from pipe. If would recommend a separate rule that would match each SEC input event and write to a separate file with write action. For example:
type=single ptype=RegExp pattern=.? desc=write each input line to a separate file action=write /var/log/sec-monitor.log $0 regards, risto 2010/12/8 M Haris Farooque <mfha...@fleetboard.com>: > hello guys, > I have another question related to Named Pipe. > I have made a "/usr/local/etc/SEC_Log_Pipe " and hang it with SEC so that > SEC can read input text from it; > > cmd1: perl -w /usr/local/sbin/sec.pl --conf=xxx.cfg --conf=yyy.cfg > --conf=zzz.cfg -input=/usr/local/etc/SEC_Log_Pipe -intevents > > I need to log some information also in a log file upon successful execution > of one of my defined rule and i wanted to use the same pipe for writing it. > > I wrote the following script <sec_log_out.pl>for writing; > > open(NAMEDPIPE, "+< $filename") or die "fifo $!"; > $| = 1; > > while (<NAMEDPIPE>) > { > print $_; > } > > and executed it as a background process like this; > cmd2: perl sec_log_pipe.pl >> /var/log/sec_monitor.log & > > but 2 seperate processes are created. (lsof /usr/local/etc/SEC_Log_Pipe > shows both processes). One processes is created by SEC i.e. <cmd1> for > taking Input and another by <cmd2> for logging out data to a log file. > Since, I always execute cmd2 after cmd1 so, logging is working fine, but SEC > is not able to take any input unless I kill the process (cmd2). > > action statement in my rule set is; > type=Single > ptype=RegExp > patter=blah,blah > desc=$0 > action= write /usr/local/etc/SEC_Log_Pipe [%u] %s > > Is there a good way to handle read/write operations through named pipe? > Thanks in advance, > -- > > Kind Reagrds/Mit freundlichen Grüßen > > M Haris Farooque > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > _______________________________________________ > Simple-evcorr-users mailing list > Simple-evcorr-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users > > ------------------------------------------------------------------------------ This SF Dev2Dev email is sponsored by: WikiLeaks The End of the Free Internet http://p.sf.net/sfu/therealnews-com _______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users