# How execute custom ruby handler using pipe in sensu GO

**URL:** <https://discourse.sensu.io/t/how-execute-custom-ruby-handler-using-pipe-in-sensu-go/1305>\
**Category:** Sensu Go\
**Created:** [August 6, 2019, 5:58pm UTC](https://discourse.sensu.io/t/how-execute-custom-ruby-handler-using-pipe-in-sensu-go/1305 "2019-08-06T17:58:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![viviraj20](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@viviraj20](https://discourse.sensu.io/u/viviraj20)\
**Post date:** [August 6, 2019, 5:58pm UTC](https://discourse.sensu.io/t/how-execute-custom-ruby-handler-using-pipe-in-sensu-go/1305/1 "2019-08-06T17:58:26Z")

</div>

Hi team,

I have ruby handler in sensu core (older version). I used pipe to execute that handler to forward some events in json format. How can i achieve same thing in SENSU GO.

Please help!

Thanks  
Vivek.

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [August 6, 2019, 6:14pm UTC](https://discourse.sensu.io/t/how-execute-custom-ruby-handler-using-pipe-in-sensu-go/1305/2 "2019-08-06T18:14:06Z")

</div>

Hey,  
So most likely what is happening is your custom ruby handler isn’t able to cope with the new event format used in Sensu Go. You’ll most likely need to adapt your handler to consume Sensu Go events. In the meantime, you should be able to continue using this version of the handler by mutating the Sensu Go event into a json that is compatibile with Sensu Core events. You have a couple of different options:

1. Is your custom ruby handler based sensu-plugin? if it is you probably only need to update the sensu-plugin gem dependency to version 4.x and make use of the new event mapping commandline argument provided as a mix-in. When active, the handler will map Sensu Go event json into Sensu Core json filling in critical json elements

> **[sensu-plugins/sensu-plugin](https://github.com/sensu-plugins/sensu-plugin#sensu-go-enablement)**
>
> A framework for writing Sensu plugins & handlers with Ruby. - sensu-plugins/sensu-plugin

1. If your custom handler isn’t using sensu-plugin you can use the `mutator-sensu-go-into-ruby.rb` mutator that comes with the updated sensu-plugin gem. It’s a stand-alone mutator command.

I find its really helpful to use the `sensuctl event info <entity> <check> --format json` command when building Sensu Go pipelines. I can see exactly what is going to be piped into the mutator and/or handler and test operation against an existing event.
