# Creating a counter out of log occurrences and scraping the log itself

**URL:** <https://discuss.elastic.co/t/creating-a-counter-out-of-log-occurrences-and-scraping-the-log-itself/250778>\
**Category:** Logstash\
**Created:** [October 2, 2020, 11:05am UTC](https://discuss.elastic.co/t/creating-a-counter-out-of-log-occurrences-and-scraping-the-log-itself/250778 "2020-10-02T11:05:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jarek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jarek1/32/76559_2.png) [@Jarek1](https://discuss.elastic.co/u/Jarek1)\
**Post date:** [October 2, 2020, 11:05am UTC](https://discuss.elastic.co/t/creating-a-counter-out-of-log-occurrences-and-scraping-the-log-itself/250778/1 "2020-10-02T11:05:27Z")

</div>

Hi Community,  
can you please advice me how to proceed with the following topic?

I am feeding unstructured logs from 3rd party application to the logstash via UDP feed. Logs are categorized by using grok script. For some log entries I don't want to keep the log itself (as the amount of the events is excessive and it is not practical to keep them) but instead I just want to create a per second or per minute counter for the occurrences of the log and store it in some variable.

I don't know how to make this counter and remove unnecessary logs.

Please help.

Best regards  
Jarek1

---

<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:** [October 2, 2020, 1:38pm UTC](https://discuss.elastic.co/t/creating-a-counter-out-of-log-occurrences-and-scraping-the-log-itself/250778/2 "2020-10-02T13:38:26Z")

</div>

Take a look at the [metrics](https://www.elastic.co/guide/en/logstash/current/plugins-filters-metrics.html) filter.

---

<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 30, 2020, 1:38pm UTC](https://discuss.elastic.co/t/creating-a-counter-out-of-log-occurrences-and-scraping-the-log-itself/250778/3 "2020-10-30T13:38:27Z")

</div>

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