Solved

Boolean filter in widget

  • 19 July 2023
  • 4 replies
  • 31 views

Badge +7

Hi, I'm trying to create a filter in a Widget but I don't know if it's possible.

I have several Hostrgroups

For example:

Client1
Client1-Database-SQL
Client1-Database-DB2
Client1-Database-MSSQL
Client2
Client2-Database-SQL
Client2-Database-DB2
Client2-Database-MSSQL
Client3
Client3-Database-SQL
Client3-Database-DB2
Client3-Database-MSSQL

I only want the hostgroups Client1 and Client2 to appear in the list

 

 

The result is all hostgroups starting with Client1 and Client2

can you help me?

Thanks

icon

Best answer by Wisonic 20 July 2023, 11:30

View original

4 replies

Userlevel 1
Badge +4

Hello @carnabil ,
try this :

Client[1,2]
 

You can use this site https://regex101.com/ for help you with regex

Badge +7

Thanks for the reply

The Client1, Client2 thing was just an example. It can be substituted for any name like ACME, MERIDIAN, SUSTRAN, ... In short, two different names

Userlevel 1
Badge +4

Ahah sorry @carnabil ,

if you just want to have client1 and client2, just add a $ at the end of your word. regex will understand that you don't want anything after your word. FYI, if you want to do the same thing but for before your word, you have to use a ^

solution of your case: Client1$|Client2$

Badge +7

It works perfectly. Thank you very much for the help

Reply