# Filebeat negate regexp

**URL:** <https://discuss.elastic.co/t/filebeat-negate-regexp/286502>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 12, 2021, 1:36pm UTC](https://discuss.elastic.co/t/filebeat-negate-regexp/286502 "2021-10-12T13:36:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_Juttner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcus_juttner/32/78690_2.png) [@Marcus\_Juttner](https://discuss.elastic.co/u/Marcus_Juttner)\
**Post date:** [October 12, 2021, 1:36pm UTC](https://discuss.elastic.co/t/filebeat-negate-regexp/286502/1 "2021-10-12T13:36:55Z")

</div>

Hello

How can I negate this

```auto
  processors:
  - drop_event:
      when:
        regexp:
          message: "^[0-9]"

```

I want to read only lines beginning with a number and ignore all others.

Thank you  
Marcus

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [October 12, 2021, 6:59pm UTC](https://discuss.elastic.co/t/filebeat-negate-regexp/286502/2 "2021-10-12T18:59:11Z")

</div>

I think u can do `when.not....`

---

<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:** [November 9, 2021, 8:59pm UTC](https://discuss.elastic.co/t/filebeat-negate-regexp/286502/3 "2021-11-09T20:59:17Z")

</div>

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