Contact Routing

Hi Folks, first time poster looking for some help!

I’m attempting to configure contact routing in our Sensu Go 6 installation as per

I’m deploying into a protected environment, so I have no internet access, and am storing assets in an artifactory repo.

As far as I can tell I’ve done everything needed but I’m getting this error in the log every time the filter is called -

"error":"ReferenceError: 'has_contact' is not defined",
"msg":"error evaluating javascript event filter",

I’m now getting three alerts per event, as it doesn’t seem to be able to identify the has_contact value in the filter, and is routing through all three email-handlers that I have set in my handler set.

Any guidance would be much appreciated.


@giinge121 can you provide your check, filter, and handler definitions?

Hey @aaronsachs-sensu - thanks for the reply. Here’s the info, all homed in a namespace called “Tooling”

Check definition as exported by sensuctl check info check-itisgitlab-http-response --namespace Tooling --format yaml

type: CheckConfig
api_version: core/v2
  created_by: cdosadmin
    contacts: dev sensuctl
  name: check-itisgitlab-http-response
  namespace: Tooling
  check_hooks: null
  command: check-http.rb
  env_vars: null
  - email
  high_flap_threshold: 0
  interval: 300
  low_flap_threshold: 0
  output_metric_format: ""
  output_metric_handlers: null
  proxy_entity_name: ""
  publish: true
  round_robin: false
  - sensu-ruby-runtime
  - sensu-plugins-http-checks
  secrets: null
  stdin: false
  subdue: null
  - tooling
  timeout: 0
  ttl: 0

Filter, as exported by sensuctl filter info contact_dev --namespace Tooling

=== contact_dev
Name:          contact_dev
Namespace:     Tooling
Action:        allow
Expressions:   has_contact(event, "dev")
RuntimeAssets: contact-filter

Handler info, as exported by sensuctl handler info handler-email-dev --namespace Tooling

    === handler-email-dev
    Name:                  handler-email-dev
    Type:                  pipe
    Timeout:               10
    Filters:               is_incident, not_silenced, contact_dev
    Execute:               RUN:  sensu-email-handler -f -t -s -P 25 -i -k -T /etc/sensu/dev_email_template
    Environment Variables: 
    Runtime Assets:        sensu-email-handler_linux_amd64

Finally, runtime asset detail sensuctl asset info contact-filter --namespace Tooling

=== contact-filter
Name:             contact-filter
Namespace:        Tooling
SHA-512 Checksum: 7793d60fbe8a2bd1998c2e68f1e96e1593e3df2ee630a8d5da11affc5ee68b3878be8d12d57360c556a40ddf2b01117cf0641e8bd53980a2df7039928ec505b3


I think I’ve resolved this issue now. I was loading the “build” assets into my local repo, not the “release” asset and so the content of the asset was completely wrong. Having realised my mistake and updated my repo everything just clicked into place.