# Logstash output file plugin adds automatically hostname

**URL:** https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113
**Category:** Logstash
**Created:** [June 1, 2022, 10:48am UTC](https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113 "2022-06-01T10:48:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [June 1, 2022, 10:48am UTC](https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113/1 "2022-06-01T10:48:18Z")

</div>

Hello

I am using Logstash version 7.8.0.

I am having my configuration as input is logstash-plain.log file which is its logfile.

It does not contain hostname , on its line, while logstash when processing data to output file , it adds hostname from where its running. I want to avoid this hostname in output file.

```auto
input {
    file {
        path => "/usrdata/logstash/logs/logstash-plain.log"
        start_position => "beginning"
        sincedb_path => "/dev/null"
        mode => ["tail"]
    }
}

filter {
    mutate {
        remove_field => ["host" , "@version", "@timestamp", "path"]
    }
}

output {
    if "ERROR" in [message] {
        file {
            codec => "line"
            path => "/usrdata/logstash/logs/chk_logstash_alertlog.log"
        }
    }
}

```

The output of the above config is

```auto
my-dbvm-for-poc-01 [2022-06-01T08:12:36,889][ERROR][org.logstash.execution.WorkerLoop][check_logstash_logfile_for_errors] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.

```

Output contains hostname "my-dbvm-for-poc-01" . I do not want this hostname to come ..

Could you please help me .

---

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [June 1, 2022, 11:33am UTC](https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113/2 "2022-06-01T11:33:07Z")

</div>

sometime it comes as

```auto
%{host} [2022-06-01T08:12:36,889][ERROR][org.logstash.execution.WorkerLoop][check_logstash_logfile_for_errors] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.

```

---

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [June 1, 2022, 4:51pm UTC](https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113/3 "2022-06-01T16:51:31Z")

</div>

Okay , I was able to achieve same using

```auto
output {
    if "ERROR" in [message] {
        file {
            codec => line { format => "%{message}" }
            path => "/usrdata/logstash/logs/chk_logstash_alertlog.log"
        }
    }
}

```

---

<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: [June 29, 2022, 4:51pm UTC](https://discuss.elastic.co/t/logstash-output-file-plugin-adds-automatically-hostname/306113/4 "2022-06-29T16:51:57Z")

</div>

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