I recently needed to export and process raw log data outside of SmartLog. Thought I would share the most interesting bit in case anybody else needs to do this.
By default, 'fwm logexport' separates fields in the output with semicolons. Unfortunately, semicolons can occur within fields. Lots of simpler tools like 'cut' and 'awk' don't deal with quote delimited fields, which can hurt the ability to extract specific columns from the data.
To deal with this issue, 'fwm logexport' has the -s switch, which causes it to use the non-printing character with hex code 0xFF to separate fields. This gets a little weird to deal with, since how do you type a non-printing character to tell your tools to use it as the field separator?
printf to the rescue! It has the ability to emit a character from its octal code:
awk -v FS=$(printf "\377") '{print $2,$3}' <some file>.ffsv
Hex 0xFF corresponds to octal 377. That will print columns 2 and 3 (usually the date and time) from a log exported via 'fwm logexport -s'.
ASCII has a few non-printing characters specifically for separating stuff: the file separator (0x1C, octal 34), the group separator (0x1D, octal 35), the record separator (0x1E, octal 36), and the unit separator (0x1F, octal 37).