# Auditbeat "drop\_event" regex performance?

**URL:** <https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258>\
**Category:** Beats\
**Tags:** auditbeat\
**Created:** [April 24, 2019, 1:05pm UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258 "2019-04-24T13:05:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ec4n6](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@ec4n6](https://discuss.elastic.co/u/ec4n6)\
**Post date:** [April 24, 2019, 1:05pm UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/1 "2019-04-24T13:05:03Z")

</div>

I'm wondering which of these drop\_event formats will give the best run time? Thanks!

```
> - drop_event:
> when.regexp.auditd.summary.actor.secondary: "root|daemon|bin"

```

vs.

```
- drop_event:
    when.or:
        - equals.auditd.summary.actor.secondary: "root"
        - equals.auditd.summary.actor.secondary: "daemon"
        - equals.auditd.summary.actor.secondary: "bin"

```

vs.

```
> - drop_event:
> - when.equals.auditd.summary.actor.secondary: "root"
> - drop_event:
> - when.equals.auditd.summary.actor.secondary: "daemon"
> - drop_event:
> - when.equals.auditd.summary.actor.secondary: "bin"
```

---

<div class="post-metadata">

**Author:** ![ec4n6](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@ec4n6](https://discuss.elastic.co/u/ec4n6)\
**Post date:** [April 30, 2019, 3:40pm UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/2 "2019-04-30T15:40:30Z")

</div>

bump 🙂

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [May 2, 2019, 9:31am UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/3 "2019-05-02T09:31:00Z")

</div>

Hi,

Pure guess from fastest to slowest I would go with:  
2,3,1

But that is pure guess, I would think you are not getting any interest because we're all very nerdy scientific-ish people who know that the only way to know is to benchmark it on a big enough sample to reveal variance, if any variance is to be found. 🙂

Do you know about the --once flag?  
[ref.](https://www.elastic.co/guide/en/beats/filebeat/current/command-line-options.html#run-command)

Consider that you can configure filebeat to output events to a local file or the console or filebeat own logs... To eliminate the factor of sending to a "true" output with latencies and all (which is not what you want to benchmark).

So you could, for example use a simple time command to start filebeat interactively in your terminal while it's configured to output to a really fast output mentioned above.

With a big enough input sample of like 50/50 events to be droped/kept, with the once command flag and a fast output, multiple runs to eliminate inter-test variance and outliers. I'm guessing you'd be able to time filebeat performance and get a definitive answer.

Let us know,

Martin

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [May 2, 2019, 9:33am UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/4 "2019-05-02T09:33:38Z")

</div>

Also consider this:  
[https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#\_literal\_registry\_flush\_literal](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#_literal_registry_flush_literal)

Since it could have impact here. You could benchmark this also 🙂

Martin

---

<div class="post-metadata">

**Author:** ![ec4n6](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@ec4n6](https://discuss.elastic.co/u/ec4n6)\
**Post date:** [May 2, 2019, 9:48am UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/5 "2019-05-02T09:48:00Z")

</div>

Appreciate the response! I was hoping whoever wrote the `drop_event` code to just know, but your guess is the same as mine. In a perfect world, all 3 would have the same runtime 😛.

I'll stick to using #2, and if performance ever becomes a problem, I'll spend some time benchmarking. Thanks!

---

<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:** [May 23, 2019, 9:48am UTC](https://discuss.elastic.co/t/auditbeat-drop-event-regex-performance/178258/6 "2019-05-23T09:48:04Z")

</div>

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