logs2dlevent [-p pf] [-d 'time' ] [-n ndays] [-v] [-l match_logname] logdir db
# # logs2dlevent.pf # match &Tbl{ UMSG recenter massrecenter masslock massunlock getconfig getannc getstatus reboot } reject &Tbl{ #Processing sbpwr Baler dopen QMASERV C1_UMSG Error Sending Issuing } dlevents &Arr{ # dlevtype log_phrase service UMSG massrecenter recenter massrecenter massrecenter sensor_lock masslock sensor_unlock massunlock sensor_cal calibration request_config getconfig request_annc getannc request_status getstatus baler Baler reboot reboot } convert_umsg &Arr{ # UMSG_comment_phrase dlevtype massrecenter massrecenter recenter massrecenter center massrecenter MRC massrecenter mrc massrecenter unlock sensor_unlock lock sensor_lock Cal sensor_cal }
Which log strings are kept are controlled by:
How the strings are mapped to dlevtypes is controlled by:
The intent for this script was to run it as a nightly cronjob on a real-time system to help summarize various interactions with the datalogger (currently only tested on a Q330). It assumes that interactions via Willard are noted with a UMSG or via output from dlcmd. Hopefully, you can convince those who interact with the datalogger via a UMSG to use standard phrases... otherwise this script might be of little use. If the output from dlcmd changes, this script will likely be less effective. There have been multiple changes in the message format for q3302orb over the years, so results may vary depending on your log vintage.
A cronjob listing in rtexec.pf that runs on Thursday grabbing the previous week of data might look like:
logs2dlevent UTC 00 12 * * 4 logs2dlevent -n 7 q330logs $DB
Capture information of interest from the previous year of logs, including any information from the current day using a locally modified log file.
logs2dlevent -n 365 -p mylogs2dlevent.pf -v q330logs year_of_logs
dlreport(1) dlcmd(1)
This program is very slow and very likely could be optimized.
The field size for the dlcomment is only 120 characters. I do not know what the limit on a UMSG size is so you may overflow the field.
There may be problems with the time subsetting, and crossing year boundaries: neither have been thoroughly tested.
It may take some adjustment of the parameter file to get (or reject) various events that you might find interesting.
Greps of log files which change format over time are obviously prone to errors. You may not get all of the information you want in the dlcomment field.
Jennifer Eakins ANF-IGPP-SIO-UCSD