Count occurrences in logs

Hi there,

we have a log line like:

Invalidating cache with patterns: pattern_1, pattern_2, pattern_3 .....

basically we would like to:

  • count over time the patterns being invalidated, e.g. in the line above there are 3 patterns so extract in some way the number of patterns in each line and count them (summing the number of patterns per line)
  • count over time each pattern how many times it gets invalidated

I’ve tried to see if there’s a split or count function that counts occurrences in each line but I haven’t found anything

Do you have control over the log format?
If so, changing this to one pattern per line would simplify things greatly.

Not myself but I can ask for that to be changed, so I assume there’s no current way to do that right?

I can’t think of a way, but perhaps one of my colleagues can think of something.