# How to process event which has \*.1.\* pattern

**URL:** <https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052>\
**Category:** Logstash\
**Created:** [April 30, 2018, 6:02pm UTC](https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052 "2018-04-30T18:02:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HRG](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@HRG](https://discuss.elastic.co/u/HRG)\
**Post date:** [April 30, 2018, 6:02pm UTC](https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052/1 "2018-04-30T18:02:15Z")

</div>

Experts:

I would like to drop all the events and process only those events which match _.1._ criteria in the message.

I have written as below but not working. Could you please help how to write using regex.

if [message] !~ /\*.1.\*/{  
drop {}  
}

I observed nothing is written to the elasticsearch index.

Any thoughts ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 30, 2018, 6:23pm UTC](https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052/2 "2018-04-30T18:23:56Z")

</div>

`*` doesn't mean what you think it means, and periods must be escaped. Regular expression solution:

```
if [message] !~ /\.1\./ {

```

A probably quicker option:

```
if ".1." not in [message] {
```

---

<div class="post-metadata">

**Author:** ![HRG](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@HRG](https://discuss.elastic.co/u/HRG)\
**Post date:** [April 30, 2018, 6:43pm UTC](https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052/3 "2018-04-30T18:43:14Z")

</div>

Thank you for the info Magnus. It worked and resolved my issue and also saved time.

Thank you so much.

---

<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 28, 2018, 6:43pm UTC](https://discuss.elastic.co/t/how-to-process-event-which-has-1-pattern/130052/4 "2018-05-28T18:43:16Z")

</div>

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