# Redirecting stdout to /dev/null

**URL:** <https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973>\
**Category:** Logstash\
**Created:** [September 8, 2022, 9:08am UTC](https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973 "2022-09-08T09:08:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jatindavey](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@jatindavey](https://discuss.elastic.co/u/jatindavey)\
**Post date:** [September 8, 2022, 9:08am UTC](https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973/1 "2022-09-08T09:08:28Z")

</div>

Hi

I am not sure if this has already been discussed in the forums but i could not find a definitive help in this regard.

Basically when i run logstash as a systemd service , whenever logstash gets log files for processing i can see that there is a high cpu usage by the systemd-journal process and not much on either logstash or elasticsearch. I dont want to maintain the stdout in the journal logs. How can i redirect this output that logstash is generating to /dev/null ?

My logstash conf file is as shown below:

input {  
file {  
start\_position =\> "beginning"  
path =\> "/home/logstash/xxxx/\*"  
sincedb\_path =\> "/home/logstash/sincedb\_xxxx"  
mode =\> "read"  
}  
}

filter {  
json {  
source =\> "message"  
}  
}

output {  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "xxxx"  
}  
stdout {}  
}

---

<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:** [September 8, 2022, 5:55pm UTC](https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973/2 "2022-09-08T17:55:06Z")

</div>

> [@jatindavey](#):
>
> How can i redirect this output that logstash is generating to /dev/null ?

Almost all logstash logs are written using log4j2, so editing /etc/logstash/log4j2.properties allows you to control what is written.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 8, 2022, 6:02pm UTC](https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973/3 "2022-09-08T18:02:57Z")

</div>

It there any reason to keep the `stdout {}` output in this case?

---

<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:** [October 6, 2022, 6:02pm UTC](https://discuss.elastic.co/t/redirecting-stdout-to-dev-null/313973/4 "2022-10-06T18:02:59Z")

</div>

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