Search the Community
Showing results for tags 'scan log'.
-
I'm a complete noob to this so bear with me. I'm trying to create a script that will perform multiple tasks, here's the list of tasks 1. Do "Action1" 2. scan new log file entries for "Y" 3. if no "Y" in new entries then repeat "Action 1" 4. if "Y" is present in new entries then end "Action 1" and do "Action 2" 5. scan new log file entries for "Z" 6. if no "Z" is present in new entries then wait 7. if "Z" is present in new entry then go to step 1 8. exit on hotkey "Y" = specific text1 "Z" = specific text2 I'm assuming I surround the whole script with the hotkey function for it to work properly. I can figure out how to script for "Action 1" and "Action 2" I can figure out how to scan a file for a phrase. What I don't know is how to scan only new entries in the file as they're input. The log file I'm scanning is accessed and changed by multiple people do to network usage(not from direct input) and I want the script to react at specific moments as users do specific things. Basically I'm just interested in the scanning part. the rest I can pretty much figure out. If you could though would you show me how I'd do the layout in the script, where I'd place the "Action 1" and the "Action 2" in the script in relation the scanning script. Also trying to keep the scan times down and not have it pick up previous entries of "Y" or "Z" only new ones Each entry is time stamped in format HH:MM:SS if that helps. There's info between the time stamp the the specific text I'm looking for that is unimportant in case that might be an issue. Also the name of the file is "Log" which is the same as many files on my comp. So how would I go about specifying the directory/folder this particular log file is in?