Right now I have something like this: index=my_index sourcetype=my_sourcetype
| rex field=message "- (?<User>\S+) -:"
| rex field=message "- (?<MessageInfo>\S+) :"
| eval Err=if(match(MessageInfo, "(Error example 1)|(Error example 2)"), 1, 0)
| eval Succ=if(match(MessageInfo, "(Success example 1)|(Success example 2)"), 1, 0)
| stats sum(Err) as ErrCount, sum(Succ) as SuccCount by User
| table User, ErrCount, SuccCount So, ErrCount gets the total count of errors for each User. However, I am writing an alert, and we only want to be alerted if there have been 10 or more errors since the last success - over a 4 hour time range. So basically: 1. By User, look at the last success message that occurred in the 4 hour time range 2. If 10 or more errors occurred since the last success message, set a flag for the User - only Users with a flag set are tabled 3. Table User and the amount of errors that occurred since the final success Is this at all possible? How could I start to go about it? I am lost on how to get the last success message and then use that to get the quantity of errors since.
... View more