Well so far, this is what I have. Just a start on this nasty program.
#!/usr/bin/php4
<?php
$lines = file("php://stdin");
foreach ($lines as $line_num => $line) {
print $line . "\n";
}
exit(0);
?>
Output looks like this.
This mail is sent by logcheck. If you do not want to receive it any more, please modify the configuration files in /etc/logcheck or deinstall logcheck.
Unusual System Events
=-=-=-=-=-=-=-=-=-=-=
Sep 15 14:04:13 server sshd[26733]: Could not reverse map address 68.191.109.205.
Sep 15 14:04:43 server sshd[26735]: Accepted publickey for zertis from 68.191.109.205 port 1762 ssh2 Sep 15 14:04:47 server su[26741]: + pts/0 zertis-root
I get the input from an internal email. I am going to run eregs on the two bottom events, and do special stuff with them. I gotta ignore the top stuff though. All emails have this in them "=-=-=-=-=-=-=-=-=-=-=" But they are all slightly different other than that. They do however follow this basic format. I just have to skip past the =-=-=-=-=-=-=-=-=-=-= so I can start running eregs where the print is right now.
I am not sure if this is actually an array or a multi lined string, but it prints array if I try to just echo out lines.