# Select only one field to output

**URL:** <https://discuss.elastic.co/t/select-only-one-field-to-output/261451>\
**Category:** Logstash\
**Created:** [January 18, 2021, 4:40pm UTC](https://discuss.elastic.co/t/select-only-one-field-to-output/261451 "2021-01-18T16:40:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Finley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/finley/32/81314_2.png) [@Finley](https://discuss.elastic.co/u/Finley)\
**Post date:** [January 18, 2021, 4:40pm UTC](https://discuss.elastic.co/t/select-only-one-field-to-output/261451/1 "2021-01-18T16:40:50Z")

</div>

Hello,

I'm trying to setup a logstash configuration. I want to forward the event.original field only on the udp output.

I have a filebeat input, and elasticsearch/udp output. I tried the "codec line" option with "format" but it does not consider the payload `%{event.original}` as a variable. Here is the configuration sample :

```auto
input {
  beats {
    port => 5044
    tags => ["serv1"]
  }

  output {
    if "serv1" in [tags] {
      elasticsearch {
        hosts => ["localhost:9200"]
        index => "serv1"
      }
      udp {
        host => ["192.168.1.1"]
        port => 514
          codec => line {
            format => "%{event.original}"
         }
     }
  }
}

```

NB : line codec is and format option is working with a syslog input.

Do you have any recommandations ?

---

<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:** [February 15, 2021, 4:40pm UTC](https://discuss.elastic.co/t/select-only-one-field-to-output/261451/2 "2021-02-15T16:40:51Z")

</div>

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