# Jef Practice: Local testing of mutated events using netcat

**URL:** <https://discourse.sensu.io/t/jef-practice-local-testing-of-mutated-events-using-netcat/1435>\
**Category:** Sensu Go\
**Created:** [November 8, 2019, 3:47am UTC](https://discourse.sensu.io/t/jef-practice-local-testing-of-mutated-events-using-netcat/1435 "2019-11-08T03:47:47Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [November 8, 2019, 3:47am UTC](https://discourse.sensu.io/t/jef-practice-local-testing-of-mutated-events-using-netcat/1435/1 "2019-11-08T03:47:47Z")

</div>

Hey Everyone!  
I found myself working with the prometheus event mutator that portertech put togther, so I could stream Sensu collected metrics into an external service that knows how to consume the prometheus metrics format.

To test everything was working, including the mutator, I spun up a very simple tcp listening service using using netcat:

```auto
nc -v -l -k localhost 9001

```

and a simple tcp handler definition making use of the prometheus mutator

```auto
api_version: core/v2
metadata:
  name: test_tcp
spec:
  mutator: sensu-prometheus-mutator
  socket:
    host: <host-ip>
    port: 9001
  type: tcp

```

When i execute a check configured to use the test\_tcp handler, I’m able to to get sample output from the handler making sure its formatted as I expect.
