# How to check with \* wildcard condition in Logstash filter

**URL:** <https://discuss.elastic.co/t/how-to-check-with-wildcard-condition-in-logstash-filter/137770>\
**Category:** Logstash\
**Created:** [June 28, 2018, 10:15am UTC](https://discuss.elastic.co/t/how-to-check-with-wildcard-condition-in-logstash-filter/137770 "2018-06-28T10:15:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [June 28, 2018, 10:15am UTC](https://discuss.elastic.co/t/how-to-check-with-wildcard-condition-in-logstash-filter/137770/1 "2018-06-28T10:15:53Z")

</div>

Hi,

I am using Logstash GA 6.3.0. In my Logstash, inside filter, I am checking a url like;

```
filter{
    if [requestUrl] == "/section1/process1" {
        //doing some stuff here
    }
}

```

This is working fine. But this wont filter if `requestUrl` is something like `/section1/process1?query`. How can I do this?

Thanks

---

<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:** [June 28, 2018, 11:09am UTC](https://discuss.elastic.co/t/how-to-check-with-wildcard-condition-in-logstash-filter/137770/2 "2018-06-28T11:09:38Z")

</div>

Use a regular expression match.

```
if [requestUrl] =~ /^\/section1\/process1/ {

```

[https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals)

---

<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:** [July 26, 2018, 11:09am UTC](https://discuss.elastic.co/t/how-to-check-with-wildcard-condition-in-logstash-filter/137770/3 "2018-07-26T11:09:39Z")

</div>

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