monitor unix file for string

Discussion in 'Perl Misc' started by jamesjesse68@yahoo.com, Feb 28, 2008.

  1. Guest

    Hello,

    I have a requirement to monitor a log file in unix using perl 5.8.
    Needed is detection of "error" in a line appended to the file.
    Also need to detect if "complete" is not found after, say, 5 hours
    after invocation.

    I expect there is a hard way and an easy way to do this - could some
    kind person advise me?
    Pointers to Fine Perldocs welcome!

    TIA

    JJ
     
    , Feb 28, 2008
    #1
    1. Advertising

  2. wrote:
    > Hello,
    >
    > I have a requirement to monitor a log file in unix using perl 5.8.
    > Needed is detection of "error" in a line appended to the file.
    > Also need to detect if "complete" is not found after, say, 5 hours
    > after invocation.
    >
    > I expect there is a hard way and an easy way to do this - could some
    > kind person advise me?
    > Pointers to Fine Perldocs welcome!



    perldoc -q tail

    How do I do a "tail -f" in perl?

    HTH,

    Josef
    --
    These are my personal views and not those of Fujitsu Siemens Computers!
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://www.fujitsu-siemens.com/imprint.html
     
    Josef Moellers, Feb 28, 2008
    #2
    1. Advertising

  3. writes:

    > Hello,
    >
    > I have a requirement to monitor a log file in unix using perl 5.8.
    > Needed is detection of "error" in a line appended to the file.


    'perldoc -q tail'

    > Also need to detect if "complete" is not found after, say, 5 hours
    > after invocation.


    'perldoc -f alarm'

    might be two useful pointers.

    //Makholm
     
    Peter Makholm, Feb 28, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Danny Jensen
    Replies:
    0
    Views:
    892
    Danny Jensen
    Jun 28, 2004
  2. Replies:
    12
    Views:
    1,650
    Dave Thompson
    Jan 10, 2005
  3. Replies:
    18
    Views:
    626
    Dave Thompson
    Jan 10, 2005
  4. ScottZ
    Replies:
    2
    Views:
    362
    Jorgen Grahn
    Nov 2, 2008
  5. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    281
    Michele Dondi
    Jan 22, 2004
Loading...

Share This Page