Could be that I'm misunderstanding your request, but that is exactly what my earlier code is doing.
It leaves out the timestring, takes the identification of the system, and then tells how many times that messages was logged, independent of the time string.