Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #intelparser.py
- import os
- def watch_log(logpath):
- lastLine = 0;
- lastFileSize = 0;
- while (!quit):
- fileStats = os.stat(logpath)
- if fileStats.st_size > lastFileSize:
- f = open(logpath, 'r')
- lines = f.readlines()
- i = lastLine
- while i < len(lines):
- line = lines[i]
- #some method to send the line to the db
- lastFileSize = fileStats.st_size
- lastLine = len(lines) - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement