reading a growing log file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • seabass

    reading a growing log file

    i need to read events from a log file as they are being logged. using
    the cookbook i added the following to my script:

    for (;;) {
    while (<FH>) { .... }
    sleep $SOMETIME;
    seek(FH, 0, 1);
    }

    this does not work correctly. when sending 15,000 lines to the log file
    only 14,938 are processed.

    if anyone has any ideas on either how to fix this or a better way to do
    it i am all ears.

    tia!

    -dj

  • seabass

    #2
    Re: reading a growing log file

    figured out that the problem was with the data and not the script

    seabass wrote:[color=blue]
    > i need to read events from a log file as they are being logged. using
    > the cookbook i added the following to my script:
    >
    > for (;;) {
    > while (<FH>) { .... }
    > sleep $SOMETIME;
    > seek(FH, 0, 1);
    > }
    >
    > this does not work correctly. when sending 15,000 lines to the log file
    > only 14,938 are processed.
    >
    > if anyone has any ideas on either how to fix this or a better way to do
    > it i am all ears.
    >
    > tia!
    >
    > -dj
    >[/color]

    Comment

    Working...