Skip to main content

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

host.endsWith('.dmz.somewhere.nl')

OR

/\.dmz.somewhere\.nl$/i.test(host)


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


David's answer still helps. You just need to create a regex expression that meets your needs. "Wildcard matching" is not supported in javascript.


/^drnms10/.+\.dmz.somewhere\.nl$/i.test(host)


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).


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.


Reply