# Logstash elasticsearch filter causing high CPU usage

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693>\
**Category:** Logstash\
**Created:** [June 18, 2020, 7:13pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693 "2020-06-18T19:13:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew22](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew22](https://discuss.elastic.co/u/Andrew22)\
**Post date:** [June 18, 2020, 7:13pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693/1 "2020-06-18T19:13:31Z")

</div>

Hello,

like the title says I am using the elasticsearch filter in logstash and it is causing high CPU usage. I am wondering if there is a way to cache the looked up results so that it may reduce the CPU usage I am seeing

regards,

---

<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:** [June 18, 2020, 8:45pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693/2 "2020-06-18T20:45:36Z")

</div>

Have you used the [performance API](https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#pipeline-stats) to verify that the problem is in the input?

---

<div class="post-metadata">

**Author:** ![Andrew22](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew22](https://discuss.elastic.co/u/Andrew22)\
**Post date:** [June 19, 2020, 2:17pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693/3 "2020-06-19T14:17:26Z")

</div>

Hello,

thank you for your response

i have enabled xpack monitoring on logstash but when i try to query for the pipeline stats like you recommended it says on the page you linked it tells me that [pipelines] is an unrecognized metric.

when i run top with the elasticsearch filter in logstash running i can see that elastic is using a lot of CPU and across all cpu's i am at 80% and when i turn it off the CPU usage of elasticsearh drops and i return to about 10-20%.

Regards,

---

<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:** [July 17, 2020, 2:17pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-causing-high-cpu-usage/237693/4 "2020-07-17T14:17:35Z")

</div>

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