-
Re: Search for custom property with exact match
d09hOct 20, 2017 3:43 PM (in response to jason.hurst)
Which type of custom property is it?
I'm speculating that if text, it may need to be integer or vice versa:
Select the Format for the property.
We recommend that you limit the string length for text properties. The string length can affect SQL performance, especially when custom properties are used in limitations. The shorter the string length, the faster the queries.
To limit the string length, click Edit, and provide the maximum number of characters.
-
Re: Search for custom property with exact match
jason.hurst Oct 20, 2017 4:21 PM (in response to d09h)It is an integer number, but I also tested this on a custom property that is text and got similar results. "State" to find "C" returned "CA" and "CT"
I am guessing that the information is used in a SQL query using LIKE instead of EQUALS, hence the results.
BTW, this is using the Search Nodes view / widget.
Jason
-
Re: Search for custom property with exact match
jason.hurst Oct 20, 2017 6:17 PM (in response to jason.hurst)Ok, I just created a custom SWQL query that works for what I wanted.
SELECT TOP 20
' ' AS Status,
N.Caption AS Node,
'/Orion/images/StatusIcons/small-' + ToString(n.StatusIcon) AS [_IconFor_Status],
'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N%3a' + ToString(n.NodeID) AS [_LinkFor_Node],
N.CustomProperties.Number
FROM Orion.Nodes N
ORDER BY N.CustomProperties.Number
And that worked just the way I want, now I just need to figure out how to submit the search string through the URL
Jason
-
-
-
Re: Search for custom property with exact match
Mark RobertsOct 22, 2017 12:05 PM (in response to jason.hurst)
May I suggest you use the Custom Query widget (previously called resources), which provides the ability to have a widget on a page that will list devices (and other useful information you may wish to include) in the listed output and provide the option to include a live search method. In your above example, add the Custom Query widget to a page, edit it and in the top window you would use your query (you can also take out the TOP too, as pagination will take care of this).
SELECT TOP 20
' ' AS Status,
N.Caption AS Node,
'/Orion/images/StatusIcons/small-' + ToString(n.StatusIcon) AS [_IconFor_Status],
'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N%3a' + ToString(n.NodeID) AS [_LinkFor_Node],
N.CustomProperties.Number
FROM Orion.Nodes N
WHERE N.CustomProperties.Number = '${SEARCH_STRING}'
ORDER BY N.CustomProperties.Number
Mark
-
Re: Search for custom property with exact match
jason.hurst Oct 23, 2017 9:18 AM (in response to Mark Roberts)That is exactly what I did.
Thanks!
-