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.

SWQL Syntax: List of SWQL (NOT SQL) Arithmetic Operators, Keywords and Logic Operators

I've been googling the past hour and looking for a list of operators (arithmetic and logic) and all the keywords used to construct SWQL filters and queries.

So far I've found six or so different resources that give about ten examples of the "=" operator and ten examples of the "LIKE" operator which does not seem to be a comprehensive guide.

Wildcards were mentioned but it doesn't say if you can use more than one in your query -->  somevariable LIKE '%foo%' matching 'myfoobar' and 'foobar' 

Is that it?   Is that all there is?   What about "NOT LIKE", which is what I'm really after in the immediate sense?  Is there an equivalent?   The resources I found also mention that it's a read only "subset" of SQL, (I am assuming they mean MSSQL) but there isn't any real definition of what that subset actually is.

Is there a resource available somewhere that I can find this information?

Parents
  • We have this documentation of functions, https://github.com/solarwinds/OrionSDK/wiki/SWQL-Functions, but never seen any for the operators.  As far as I can tell it supports everything you can do in SQL server.

    https://www.w3schools.com/sql/sql_wildcards.asp although I admin I have never tried the bracket stuff, but I use % and _ in a million ways every day.  Like, not like, in, between, etc.

    I also just realized a good way to validate a syntax is just to run SWQL studio as it's syntax suggestions seem to contain all available functions as well.

    https://github.com/solarwinds/OrionSDK/releases  In hindsight I probably learned all the quirks of SWQL that I know from trying things out in there.

  • ...and I found out what I was doing but not what the problem is.   I was trying to modify the "Edit Resource: Top XX Interfaces by Percent Utilization" on the Network Top 10 default dashboard.   

    I'm unclear if this area takes the full SWQL statement or just a portion that is relevant.   For example, in SWQL Studio, this statement produces what I want without error:

    SELECT Caption from Orion.NPM.Interfaces WHERE Caption NOT LIKE '%Tunnel%'

    However, since I have to assume it's only going to pick interfaces anyway under the "filter interface" box, I tried this:

    Caption NOT LIKE '%Tunnel%'

    ...and it doesn't like that at all.  When I examine the result on the Network Top 10 dashboard, that widget simply tells me:

    Custom SQL filter is incorrectly formatted.
  • Help me, Obi Wan mseverrum, you're my only hope! Laughing

Reply Children
No Data