# Split message by field to different outputs

**URL:** <https://discuss.elastic.co/t/split-message-by-field-to-different-outputs/40296>\
**Category:** Logstash\
**Created:** [January 27, 2016, 10:28pm UTC](https://discuss.elastic.co/t/split-message-by-field-to-different-outputs/40296 "2016-01-27T22:28:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Popov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_popov/32/7154_2.png) [@Alexander\_Popov](https://discuss.elastic.co/u/Alexander_Popov)\
**Post date:** [January 27, 2016, 10:28pm UTC](https://discuss.elastic.co/t/split-message-by-field-to-different-outputs/40296/1 "2016-01-27T22:28:38Z")

</div>

I have udp input with json codec

my records looks like :

```auto
{
"id":"value",
"field1:"val",
"fieldN:"val",

details: { big nested structure }
}

```

How can I split this message into

```auto
{
"id":"value",
"field1:"val",
"fieldN:"val",
}

```

and `{ big nested structure }`  
and push it into different outputs, first should go into elastic search and details should go into S3, ideally with key == id from main record

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 28, 2016, 7:19am UTC](https://discuss.elastic.co/t/split-message-by-field-to-different-outputs/40296/2 "2016-01-28T07:19:01Z")

</div>

You can use the clone filter to split each event in two. Then you can apply different transforms on each copy of the message.

---

<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:** [July 6, 2017, 5:14am UTC](https://discuss.elastic.co/t/split-message-by-field-to-different-outputs/40296/3 "2017-07-06T05:14:00Z")

</div>


