in reply to Outputting syslog to some perl code

Sorry, I'm not familiar with the situation you're describing, which probably explains why I have this question:

Why do you have the "open()" and "close()" inside the while loop, rather than outside?

  • Comment on Re: Outputting syslog to some perl code

Replies are listed 'Best First'.
Re: Re: Outputting syslog to some perl code
by Binford (Sexton) on Nov 06, 2002 at 17:28 UTC
    Technically I wouldn't normally have the open and close inside the loop, it was there as one of the last things I tried (thinking on the off chance that it might be something funky with the IO coming from syslog).

    I took the LINUX syslog(5) manpage to mean you could pipe the logdata to a normal command and then do what you would with the data.

    I am trying to parse the openldap log files for failed authentication messages and based on that re-write the data to a IPTABLES format to stop any attempts to access a given IP until authentication is correct. I've got some failry complex (for me anyway) regex writtenm inside that loop to parse the log data, but have gotten stuck with this whole syslog issue.

    Based on your replies, I think my knowledge is lacking in the area of "named pipes" as opposed to pipes as I understood them.

    SO, I guess this isn't really a perl issue at this point, but I am stumped as to where go look for resolution. I guss I will go back to logging to a file and then use perl's IO::Handle functions to continaully monitor the trailing end of said file. I just thought it ould be more elegant to send the data directly to my program, doe my processing on it and write the log file out from within POST processing.

    Binford