# Only write a particular field of an event to a tcp socket

**URL:** <https://discuss.elastic.co/t/only-write-a-particular-field-of-an-event-to-a-tcp-socket/68217>\
**Category:** Logstash\
**Created:** [December 6, 2016, 8:16pm UTC](https://discuss.elastic.co/t/only-write-a-particular-field-of-an-event-to-a-tcp-socket/68217 "2016-12-06T20:16:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![niteshjain92](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niteshjain92/32/13663_2.png) [@niteshjain92](https://discuss.elastic.co/u/niteshjain92)\
**Post date:** [December 6, 2016, 8:16pm UTC](https://discuss.elastic.co/t/only-write-a-particular-field-of-an-event-to-a-tcp-socket/68217/1 "2016-12-06T20:16:12Z")

</div>

Using the latest logstash and my current config is :  
input {  
kafka {....}  
}

output {  
tcp {  
port =\> 10001  
}  
}

I can see with this config, the data written to the socket is:

$ nc -l -p 10001  
{"@timestamp":"2016-12-06T19:52:47.046Z","@version":"1","message":"test 1 1","tags":[]}

I want to write only "test 1 1" to the tcp socket.

Any suggestions, apart from actually making changes to the tcp output plugin ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 6, 2016, 8:16pm UTC](https://discuss.elastic.co/t/only-write-a-particular-field-of-an-event-to-a-tcp-socket/68217/2 "2016-12-06T20:16:44Z")

</div>

> [@niteshjain92](#):
>
> apart from actually making changes to the tcp output plugin

There is no other way.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 3, 2017, 8:16pm UTC](https://discuss.elastic.co/t/only-write-a-particular-field-of-an-event-to-a-tcp-socket/68217/3 "2017-01-03T20:16:55Z")

</div>

Closed on January 3, 2017, 8:16pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
