Skip to main content
Solved

Boolean filter in widget

  • July 19, 2023
  • 4 replies
  • 46 views

Forum|alt.badge.img+8

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

Best answer by Wisonic

Hello @carnabil ,
try this :

Client[1,2]
 

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

4 replies

Forum|alt.badge.img+4
  • Steward *
  • 19 replies
  • Answer
  • July 20, 2023

Hello @carnabil ,
try this :

Client[1,2]
 

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


Forum|alt.badge.img+8
  • Author
  • Steward ***
  • 33 replies
  • July 20, 2023

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


Forum|alt.badge.img+4
  • Steward *
  • 19 replies
  • July 20, 2023

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$


Forum|alt.badge.img+8
  • Author
  • Steward ***
  • 33 replies
  • July 20, 2023

It works perfectly. Thank you very much for the help