Skip to main content
Question

filter expresion in route with wildcard

  • March 11, 2025
  • 6 replies
  • 43 views

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

6 replies

David Maislin

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

OR

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


  • Author
  • Participating Frequently
  • March 11, 2025

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


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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


David Maislin

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


  • Author
  • Participating Frequently
  • March 11, 2025

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


Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

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.