Your comments

Thanks buddy, it was my fault. it's working 100% now

Surely there is something that already exists that can read a log file and pull out the keywords, on the fly.