divisionbyzero

question . authority

Using POE to hook syslog-ng

Being able to do analysis, sorting, or database storage of syslog messages is incredibly useful. There are tons of solutions on the market to do just that. If you’re working on a system developed in house that you’d like to incorporate syslog messages into, then it may be easier to hook directly into the syslog stream than to introduce another piece of software into the environment which needs to be glued.

Syslog-ng facilitates easy integration with Perl binaries as the Perl program is spawned once during the daemon start up and a handle to that program’s STDIN is maintained for dispatching of messages. Using POE, we can turn this into an event driven model, making additional complexity simple.

In this example, we’ll create a POE Master session that receives all of the syslog-ng input from STDIN. Using off the shelf components, we’ll run a TCP Server on port 9514 that will allow clients to connect and subscribe to feeds based on the “program” name of the message being dispatched.
Read the rest of this entry »

Perl Iron Man Contest

Matthew S Trout has started a Perl Iron Man challenge to encourage Perl users to become active in the blogosphere.  Not many people outside of the Perl echo chamber realize how active and modern the language.  A lot of the concepts that trampolined Ruby and Python into the forefront of Web 2.0 have been alive and well in the Perl community for a long time.  With the advent of Moose, Perl5 is as serious an Object Oriented language as Python and Ruby.

I entered myself today.  The goal is blog about Perl atleast once a week.  As I’m splitting my development time between a Catalyst Project and a number of POE projects, I expect my posts to be along those lines.  I’ll eventually share my DBIx::Class scripts as well.  There should be something for everyone, especially @strcpy!  (He loves my Perl blogging).

Look for code related stuff early next week!