cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Host naming Regex to exclude management IP addresses

Babar_Qayyum
DynaMight Guru
DynaMight Guru

Dear All,

When we apply the hostname format with the Host:IpAddress condition, it provides us with all the detected IP addresses of the host (including the management IP addresses). However, we would like to see only a particular IP address from the below examples (the purple one). 

HostName - 000.000.000.000, 111. 111. 111. 111, 222.222.222.222

How can we write the REGEX to extract the desired IPs?

Note: The workaround is to exclude the NIC, but it could be a tedious job with multiple hosts.

Regards,

Babar Qayyum

3 REPLIES 3

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

I would say using same as for service name format but in Host naming.

Of course, you need to know correct regex for that purpuse.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Hello @AntonPineiro 

Thank you for your comments.
Until now, I could not find any correct REGEX, unfortunately. Therefore, I was seeking community support to assist in this.

Regards,

Babar Qayyum

Please try this regex:

\b111\.111\.111\.111\b

or

(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3},\s)(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})

Have a nice day!

Featured Posts