filter expresion in route with wildcard
Hi,
Maybe a simple answer (i hope). For a route we want to filer the host.name, but there are a lot of host in the list so a wildcard is the best way to filter.
So doing like 'drnms10*.dmz.somewhere.nl' in the filter for the servers matching with this wildcard.
But with a filter 'host == 'drnms10*.dmz.somewhere.nl'' wil not work. What is the best way to do this?
I tried with a C.lookup and a lookup file.. it wil work. But stil have top maintain a list. And is a C.lookup not very slow in a filter?
Thanks for the answer :)
greets
Jari
Answers
-
host.endsWith('.dmz.somewhere.nl')
OR
/\.dmz.somewhere\.nl$/i.test(host)
0 -
Thanx David,
Not exactly what i wanted. I like to have a filter for every host staring with drnms10 .. and everythine in between, but also ending with .dmz.somewhere.nl.
hence the drnms10*.dmz.somewhere.nl
0 -
David's answer still helps. You just need to create a regex expression that meets your needs. "Wildcard matching" is not supported in javascript.
0 -
/^drnms10/.+\.dmz.somewhere\.nl$/i.test(host)
0 -
Ahhh now i see. Yes this helps indeed.
Does it matter about the cpu resources it cost?
I can make a filter with a lot off host in the filter or this regex.
I don't like to use a list of servers in the filter, but when it cost a lot of cpu power (with loads of events i mean).
0 -
Yes, CPU performance could be a concern. You normally want to make your filters as efficient as possible. I cannot tell from the info that you've provided what you're trying to do tho.
0