SensuGO Event Filter Regular Expression examples

Hello Team - Hope everyone is doing great. Could you share some tips on how to have a event filter expression that use regular expressions. For example, I want to trigger the handler if and only my check output matches a specific text.

I did look at https://github.com/robertkrimen/otto/blob/master/README.markdown and https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-filter/filters/ , but not finding example.

Appreciate your help on this.

Thanks
MK

1 Like

Figured it out, you could try something like this. Something like this for string matching.

event.check.output.match(/CRITICAL/).length > 0
1 Like