# Can I get only one data in logstash's output?

**URL:** <https://discuss.elastic.co/t/can-i-get-only-one-data-in-logstashs-output/259626>\
**Category:** Logstash\
**Created:** [December 25, 2020, 9:45am UTC](https://discuss.elastic.co/t/can-i-get-only-one-data-in-logstashs-output/259626 "2020-12-25T09:45:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iooi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iooi/32/79231_2.png) [@iooi](https://discuss.elastic.co/u/iooi)\
**Post date:** [December 25, 2020, 9:45am UTC](https://discuss.elastic.co/t/can-i-get-only-one-data-in-logstashs-output/259626/1 "2020-12-25T09:45:06Z")

</div>

Can I get only one data in logstash's output?

If the data after filter like:

```auto
"a" => 1,
"b" => 2,
"c" => 3,

```

in the output, send it to elasticsearch.

```auto
output {
    elasticsearch {
        protocol => http
        host => "ES_NODE_HOST"
    }
}

```

I want to add another output but only get `a`:

```auto
output {
    elasticsearch { # It get a,b,c
        protocol => http
        host => "ES_NODE_HOST"
    }
    file { # It get a
      path => ...
      codec => line { format => "custom format: %{message}"}
    }
}

```

Is it possible?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [December 25, 2020, 4:09pm UTC](https://discuss.elastic.co/t/can-i-get-only-one-data-in-logstashs-output/259626/2 "2020-12-25T16:09:15Z")

</div>

You could use pipeline to pipeline communications with the [forked path](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html#forked-path-pattern) pattern.

However, with an output configured with

```
codec => line { format => "custom format: %{message}"}

```

the output will not have the fields [a], [b], or [c], only [message]. If you just want field [a] you could use

codec =\> line { format =\> "custom format: %{a}"}

---

<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 22, 2021, 4:09pm UTC](https://discuss.elastic.co/t/can-i-get-only-one-data-in-logstashs-output/259626/3 "2021-01-22T16:09:26Z")

</div>

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