Sum of values from a field after pattern

Is it possible to do some kind of sum with the content of fields after it has gone trough a pattern.

For example the following loki quey results in lines only containing >0 records.

{filename=~"/DIR/server/cur/server.*log",host=“localhost”}!~".SomeStrring."| pattern "<RS_Code> | | | Project = , transactions processed since , next statistical log at: " | records>0

My goal is to sum the number of records per Project