This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

IPAM Search - Subnet Custom Properties

I need to ability to search through custom properties in IPAM. The current search feature does not allow it.

I added a Custom Query widget to the IPAM Summary page and built a SWQL query to accomplish what i needed.

The widget looks like this where it just shows all subnets.

2020-06-09 15_27_21-Window.png

Searching for 'test', which is an assigned custom property value, shows any results that match.

2020-06-09 15_27_38-Window.png

Searching for 'location', which is the friendly name of at least two subnet, shows any results that match.

2020-06-09 15_35_57-Window.png

Clicking on any of the subnet names takes me to the Manage Subnets and IP Address page with that respective subnet highlighted.

2020-06-09 15_27_52-Window.png

The guts of the query itself are as follows. **Note: You will need to update the query to include all of the IPAM Custom Properties that you would like to search with.**

Custom SWQL Query

-- Scripts are not supported under any SolarWinds support program or service. 
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further 
-- disclaims all warranties including, without limitation, any implied warranties 
-- of merchantability or of fitness for a particular purpose. The risk arising 
-- out of the use or performance of the scripts and documentation stays with you. 
-- In no event shall SolarWinds or anyone else involved in the creation, 
-- production, or delivery of the scripts be liable for any damages whatsoever 
-- (including, without limitation, damages for loss of business profits, business 
-- interruption, loss of business information, or other pecuniary loss) arising 
-- out of the use of or inability to use the scripts or documentation.

SELECT DISTINCT
  FriendlyName
,CASE
    WHEN StatusName = 'Up' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.up.gif'
    WHEN StatusName = 'Warning' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.Warning.gif'
    WHEN StatusName = 'Critical' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.Critical.gif'
    ELSE '/Orion/IPAM/res/images/sw/icon.Subnet.ok.gif'
    END AS [_IconFor_FriendlyName]
, '/Orion/IPAM/Subnets.aspx?opento=' + ToString(GroupId) AS [_LinkFor_FriendlyName]
, Address
, CIDR
, Comments
, Location
-----------------------------------------------------------------
-- UPDATE THE BELOW LINE TO THE NAME OF YOUR IPAM CUSTOM PROPERTY
-- e.g. i.CustomProperties.<custom property name> AS [Some Name]
, i.CustomProperties.IP_Subnet_Custom_Field AS [SiteName]
-----------------------------------------------------------------
FROM IPAM.GroupNode i
WHERE (GroupTypeText LIKE 'Subnet' OR GroupTypeText LIKE 'Supernet')
ORDER BY Address ASC

Search SWQL Query

-- Scripts are not supported under any SolarWinds support program or service. 
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further 
-- disclaims all warranties including, without limitation, any implied warranties 
-- of merchantability or of fitness for a particular purpose. The risk arising 
-- out of the use or performance of the scripts and documentation stays with you. 
-- In no event shall SolarWinds or anyone else involved in the creation, 
-- production, or delivery of the scripts be liable for any damages whatsoever 
-- (including, without limitation, damages for loss of business profits, business 
-- interruption, loss of business information, or other pecuniary loss) arising 
-- out of the use of or inability to use the scripts or documentation.

SELECT DISTINCT
  FriendlyName
, CASE
    WHEN StatusName = 'Up' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.up.gif'
    WHEN StatusName = 'Warning' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.Warning.gif'
    WHEN StatusName = 'Critical' THEN '/Orion/IPAM/res/images/sw/icon.Subnet.Critical.gif'
    ELSE '/Orion/IPAM/res/images/sw/icon.Subnet.ok.gif'
    END AS [_IconFor_FriendlyName]
, '/Orion/IPAM/Subnets.aspx?opento=' + ToString(GroupId) AS [_LinkFor_FriendlyName]
, Address
, CIDR
, Comments
, Location
 --vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv--
 -- UPDATE THE BELOW LINE TO THE NAME OF YOUR IPAM CUSTOM PROPERTY
 -- e.g. AND ( i.CustomProperties.<custom property name> LIKE '%${SEARCH_STRING}%'
, i.CustomProperties.IP_Subnet_Custom_Field AS [SiteName]
 --^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
FROM IPAM.GroupNode i
WHERE (GroupTypeText LIKE 'Subnet' OR GroupTypeText LIKE 'Supernet') 
 --vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv--
 -- UPDATE THE BELOW LINE TO THE NAME OF YOUR IPAM CUSTOM PROPERTY
 -- e.g. AND ( i.CustomProperties.<custom property name> LIKE '%${SEARCH_STRING}%'
 AND ( i.CustomProperties.IP_Subnet_Custom_Field LIKE '%${SEARCH_STRING}%' 
 --^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
  OR FriendlyName LIKE '%${SEARCH_STRING}%' 
  OR Address LIKE '%${SEARCH_STRING}%' 
  OR Comments LIKE '%${SEARCH_STRING}%' 
  OR Location LIKE '%${SEARCH_STRING}%')
ORDER BY Address ASC