syslog-ng-users December 2010 archive
Main Archive Page > Month Archives  > syslog-ng-users archives
syslog-ng-users: Re: [syslog-ng] advice/assistance with parsing

Re: [syslog-ng] advice/assistance with parsing attempt requested

From: <syslog-ng2010_at_nospam>
Date: Wed Dec 08 2010 - 16:58:36 GMT
To: "Syslog-ng users' and developers' mailing list" <syslog-ng@lists.balabit.hu>

thanks for all the help ...

in parser.py, i was using sys.stdin.readlines() which, i wound up
changing to sys.stdin.xreadlines() to get the desired results.

many thanks again!

On Wed, 08 Dec 2010 16:50:37 +0100 Lars Kellogg-Stedman
<lars@oddbit.com> wrote:
>>
>> the issue has me really stumped. how/why would the output from
>perl
>> make it to /opt/syslog-ng/logs/logfile in "real-time" yet, the
>> output from python only make it to /opt/syslog-ng/logs/logfile
>as a
>> batch upon stopping the service!?!?
>>
>
>This sort of thing typically happens because the program is using
>buffered
>IO, and output is only flushed when the buffer is full. If you
>were to
>leave things running for a while and generate a lot of log
>traffic, you
>would probably see the output show up periodically in large
>chunks.
>
> This thread on Stackoverflow discusses a variety of solutions to
>the
>problem:
>
> http://stackoverflow.com/questions/107705/python-output-
>buffering
>
>The simplest is probably to run Python with the "-u" flag (or
>output to
>stderr instead of stdout).

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.campin.net/syslog-ng/faq.html