Hook K:lines into the STATS command and write them to storage