How to check with * wildcard condition in Logstash filter


#1

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


(Magnus B├Ąck) #2

Use a regular expression match.

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

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


(system) #3

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