# Don't drop event postgresql.activity.query

**URL:** <https://discuss.elastic.co/t/dont-drop-event-postgresql-activity-query/259749>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 28, 2020, 5:25pm UTC](https://discuss.elastic.co/t/dont-drop-event-postgresql-activity-query/259749 "2020-12-28T17:25:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guto\_Ribeiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guto_ribeiro/32/81479_2.png) [@Guto\_Ribeiro](https://discuss.elastic.co/u/Guto_Ribeiro)\
**Post date:** [December 28, 2020, 5:25pm UTC](https://discuss.elastic.co/t/dont-drop-event-postgresql-activity-query/259749/1 "2020-12-28T17:25:50Z")

</div>

Hello guys,

I'm using metricbeat to collect metrics from postgresql, via the postgresql module.

I need to drop events with:

- postgresql.activity.query: "COMMIT"
- postgresql.activity.query: ""

In the metrcibeat configuration I have:

```auto
   - drop_event:
       when:
         or:
           - regexp:
               postgresql.activity.query.text: "^SET.*"
           - regexp:
               postgresql.statement.query: "^COMMIT.*"
           - regexp:
               postgresql.statement.query.text: "^COMMIT.*"
           - equals:
               postgresql.activity.query.text: ""
           - equals:
               postgresql.activity.query: ""

```

Only events with postgresql.activity.query are not dropped. The rest are working.

I tried to configure to drop only the events with:

```auto
   - drop_event:
       when:
         or:
           - regexp:
               postgresql.statement.query: "^COMMIT.*"
           - equals:
              postgresql.activity.query: ""

```

It also didn't work. I also configured with equals instead of regexp, to no avail.

Does anyone know how to solve?

---

<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:** [January 25, 2021, 7:26pm UTC](https://discuss.elastic.co/t/dont-drop-event-postgresql-activity-query/259749/2 "2021-01-25T19:26:10Z")

</div>

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