User tools

Site tools


Gather & convert Dante Controller logs

Here is the code used in the utility:

(* Gather Dante Controller logs into a file on the Desktop and convert timstamps to a readable form
 
www.allthatyouhear.com | Please attribute this work if you share it, and please report any bugs or issues you encounter
 
v1.0:	15/07/19		Rich Walsh
v1.0.1:	15/07/19		Removed unneeded option to remove first line in awk – tail is doing that
					Corrected awk to use tab-delimited rather than comma-delimited, not that it actually mattered
 
<<< Last tested with Dante Controller 4.1.0, MacOS 10.14.5 >>> *)
 
-- Declarations
 
property dialogTitle : "Gather & convert Dante Controller logs"
 
property theExplanation : "This no-frills utility will gather Dante Controller logs from ~/Library/Logs/Audinate/ into a single file on the Desktop, " & ¬
	"convert the timestamps into a more readable form and open the file.
 
You can also choose to process files from a different folder, but the results may be unexpected if the folder doesn't contain raw log files from Dante Controller."
 
-- Choose the folder
 
activate
 
set theChoice to button returned of (display dialog theExplanation with title dialogTitle with icon 1 ¬
	buttons {"Cancel", "Choose folder…", "OK"} default button "OK" cancel button "Cancel")
 
if the theChoice is "OK" then
	set sourceFolder to "~/Library/Logs/Audinate/"
else
	set sourceFolder to POSIX path of (choose folder with prompt "Choose folder of Dante Controller log files to process:" default location path to desktop)
end if
 
try
 
	-- Merge the files and convert the timstamps
 
	do shell script "tail -n +2 -q " & sourceFolder & "DanteController-[0-9]*.log | awk 'BEGIN { FS = \"\\t\" ; OFS = \"\\t\" } { cmd = (\"date -r \"substr($1,1,10)\" '\\''+%y-%m-%d %H:%M:%S'\\''\") ; cmd | getline timestamp; close(cmd); $1=substr($1,11); print timestamp \".\" $0 }'  > ~/Desktop/Dante_Controller_logs.log"
 
	-- Open the file
 
	do shell script "open ~/Desktop/Dante_Controller_logs.log"
 
on error theError number errorNumber
 
	if errorNumber = -128 then return
	display alert dialogTitle & ": Unexpected Error" message "Error number " & errorNumber & ": " & theError as critical buttons {"OK"} default button "OK"
 
end try
gather_convert_dante_controller_logs.txt · Page views to date: 2421 · Last modified: 2021/03/23 13:31 (External edit)