Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I currently have two machines that receive about 1000 HTTP req/sec both and generate a log entry on every request. This log is centralized on a syslog daemon running on a different machine.

For reasons not really relevant, I will need to have those logs sent to an internal pub/sub server (each log entry will be a JSON payload sent over UDP), for further treatment in [near] real-time.

I was thinking about keeping everything up until the syslog daemon, because I still need those logs centralized, but was wondering how I could take it from there to the pub/sub server. A few things currently crossing my mind are not particularly brilliant:

  • use syslog-ng with a pipe as a destination and have a small process picking up stuff from there, processing it and sending it via UPD
  • have a small process tailing the centralized log file, processing new entries and sending them via UPD.

I'd love to hear some more experienced folks that might have had a similar problem. Ideally syslogd would receive logs from the different machines, perform its required transformations to JSON, send it over UPD and then also write it locally to the centralized log file. Everything is really debatable and opened to discussion, since there might be other solutions I never even heard of.

There's not really a requirement for performance here (1000 req/sec is a really small scale). The only real requirement here is that it should be as close to real-time as possible (about 10 seconds delay or something is acceptable).

share|improve this question

1 Answer 1

up vote 0 down vote accepted

syslog-ng is (IMHO) the correct way to do this. Once you receive the message, send it to a Perl script using the program() destination in syslog-ng. If you want to search and chart/graph after parsing it, try a tool like LogZilla that will work in-line with what you are trying to do. Perl can, without any special work, process up to around 35k events per second, so you are good there. Check here for an overview picture of how this is done in LZ (which also uses a Perl program destination).

share|improve this answer
    
Thanks for the answer Clayton. There's really no other way around it I guess. –  Pedro Mata-Mouros Jun 19 '12 at 14:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.