in reply to extract last 1 min log and find a string

Hey, folks. The log file actually is not that big. What I want to achieve is to match a string 'running mode' to make sure every thing is on the track. The file keeps updating quickly at the first 10 mins I think. So the solutions I could think of are:1 keep tracking every 2 min to search this string. 2 keep tailing 100 lines (this might not be working, because it is hard to catch the point which I tailed) 3 comparing the size of file until it is not increasing, extracting the bottom lines to match the string. Do you have any better solution? and what kind of module I could leverage in this case? Thanks!
  • Comment on Re: extract last 1 min log and find a string

Replies are listed 'Best First'.
Re^2: extract last 1 min log and find a string
by hippo (Archbishop) on Jul 21, 2017 at 14:02 UTC
    what kind of module I could leverage in this case?

    File::Tail should do the trick.