# How to remove field in logstash output

**URL:** <https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055>\
**Category:** Logstash\
**Created:** [March 18, 2020, 9:06am UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055 "2020-03-18T09:06:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neal1991](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neal1991/32/23178_2.png) [@neal1991](https://discuss.elastic.co/u/neal1991)\
**Post date:** [March 18, 2020, 9:06am UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055/1 "2020-03-18T09:06:28Z")

</div>

I have set up an ELK stack. For the logstash instance, it has two output including Kafka and elasticsearch.

For the output of elasticsearch, I want to keep the field @timestamp. For the output of Kafka, I want to remove the field @timestamp. So I cannot just remove field @timestamp in the filter. I just want it removed for the Kafka output.

I have not found this kind of solution.

---

<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:** [March 18, 2020, 3:49pm UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055/2 "2020-03-18T15:49:21Z")

</div>

Use pipeline-to-pipeline communication with a [forked path pattern](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html#forked-path-pattern).

---

<div class="post-metadata">

**Author:** ![neal1991](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neal1991/32/23178_2.png) [@neal1991](https://discuss.elastic.co/u/neal1991)\
**Post date:** [March 19, 2020, 4:33am UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055/3 "2020-03-19T04:33:34Z")

</div>

It seems that pipeline is enough. Just seperate the config of different outputs.

---

<div class="post-metadata">

**Author:** ![neal1991](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neal1991/32/23178_2.png) [@neal1991](https://discuss.elastic.co/u/neal1991)\
**Post date:** [March 19, 2020, 5:12am UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055/4 "2020-03-19T05:12:25Z")

</div>

Try to set the pipelines.yml

```auto
- pipeline.id: stdout
    queue.type: persisted
    config.string: |
    input {
      beats {
        port => 5044
      }
    }

    output {
      stdout{}
    }

- pipeline.id: kafka
    queue.type: persisted
    config.string: |
    input {
      beats {
        port => 5044
      }
    }
    
    output {
      kafka {
        codec => json
        topic_id => "zeek-http"
      }
    }

```

Start the logstash: `./bin/logstash --path.settings /Users/dongbing/tool/ELK/logstash-7.4.0/config -t`. But it always indicates:

```auto
[2020-03-19T13:04:17,589][DEBUG][logstash.config.source.multilocal] Reading pipeline configurations from YAML {:location=>"/Users/dongbing/tool/ELK/logstash-7.4.0/config/pipelines.yml"}
ERROR: Failed to read pipelines yaml file. Location: /Users/dongbing/tool/ELK/logstash-7.4.0/config/pipelines.ym\

```

---

<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:** [April 16, 2020, 5:12am UTC](https://discuss.elastic.co/t/how-to-remove-field-in-logstash-output/224055/5 "2020-04-16T05:12:33Z")

</div>

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