Last active
August 29, 2015 14:18
-
-
Save slashdoom/fe4ba97611861c4f9013 to your computer and use it in GitHub Desktop.
Template for PHP based external syslog-ng log parser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
# open stdin | |
$s = fopen('php://stdin','r'); | |
# check stdin for new logs | |
while ($input = fgets($s)) { | |
# do stuff with $input | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment