NewGuy
NewGuy

Reputation: 3423

Search graylog for string with dash and numerals?

I am having an issue finding the proper query syntax to search for the following string in my graylog messages:

Example strings:

/path-one/12/status
/path-one/18/status
/path-one/103/status
/path-one/9821/status

These are in the request_url field.

I've tried the following:

request_url:"/path\-one/.+/status" => Returns No results
request_url:/path-one/.+/status => Malformed in the following location and points to "/path-one/"
request_url:/path\-one/.+/status => Malformed in the following location and points to "/path\-one/"
request_url:/path-one/[0-9]+/status => Malformed in the following location and points to "[0-9]"

What is the proper syntax to find the strings I want where the middle section can be a positive number?

Upvotes: 1

Views: 3559

Answers (1)

Jan
Jan

Reputation: 43179

You could try

\/path-one\/[0-9]+\/status

See a demo on regex101.com.

Upvotes: 1

Related Questions