OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: rabievdm on October 25, 2017, 04:51:13 pm

Title: [SOLVED] Filter params when searching logs
Post by: rabievdm on October 25, 2017, 04:51:13 pm
Hi,

Am I just being stupid, is there a way to specify and explicit value when using the WUI to search the firewall logs?
eg: Going to Firewall>Logs>Normal View and searching for an ip of "192.168.0.1" and it would return 192.168.0.1* ie .1 and any combination of .1
....
I have found that a $ at the end seems to terminate the search so I have my answer, but now I am wondering are there any other permissable wildcards? "*" doesn't seem to work?
Title: Re: Filter params when searching logs
Post by: franco on October 25, 2017, 08:58:48 pm
Hi there,

It's a full regex. Didn't even know that. 8)

".*" is short for 0-n characters of anything. "1*" is short for 0-n characters of 1. So you need "1.*".

For the full thing see e.g. https://www.debuggex.com/cheatsheet/regex/pcre


Cheers,
Franco
Title: Re: Filter params when searching logs
Post by: franco on October 25, 2017, 09:00:02 pm
PS: On a somewhat silly note the "." in an IP address is actually matched by "\.", otherwise it can match more.
Title: Re: Filter params when searching logs
Post by: rabievdm on October 27, 2017, 09:09:31 am
Thanks Franco, I did try regex, but prob messed it up, I'm a little rusty :)