ContributionsMost RecentMost LikesSolutionsAPI Filtering Info Hi Everyone, I've found myself doing the same searches on API filtering multiple times, so wanted to gather and share some of what I've found & learned in hopes of helping others out (and let's be honest, I'll likely need to reference this again in a few months, so it's mutually beneficial). If you find a good link or have anything to add, please feel free to respond here and add it, it might help someone else down the road. Thanks! I usually start at theGet Devices Examplethat shows the operators nicely, but doesn't give enough examples for me: filter filter=property{operator}value Filters the response according to the operator and value specified. Note that you can use * to match on more than one character. You can use the ‘.’ character to filter values within an object (e.g. custom properties), and multiple filters can be separated by a comma. See Example 5. Operators include: Greater than or equals:>: Less than or equals:<: Greater than:> Less than:< Does not equal:!: Equals:: Includes:~ Does not include:!~ /device/devices?filter=name~QA* Also, keep an eye out for filtering for special characters. There's some additional info in theREST API v2 Overview: Filter Syntax Filter query parameter values with special characters require encoding. Specifically: Filter query parameter values with special character "+" must be encoded twice. For example, the parameter value in this request GET /device/devices?filter=name:"Prod+Server" should be encoded twice for a result of: "Prod%252BServer" Filter query parameter values with special characters EXCEPT "+" (&, -, and so on) must be encoded once. For example, the parameter value in this request GET /device/devices?filter=name:"Prod&Server" should be encoded once for a result of: "Prod%26Server" Here are a few simple examples: Filtering for a custom property (note that the name and value are separate filters as @David Bondexplains here): ?filter=customProperties.name:NameOfProperty,customProperties.value:ValueToFind Filtering for X OR Y (meaning the API will return entries matching either one): ?filter=dataSourceName:X|Y Filtering for X AND Y (meaning the API will return entries that match BOTH): ?filter=enableNetflow:X,netflowCollectorId:Y ##EXTERNALTICKETID## available to pass to escalations Would it be possible to allow LogicMonitor to pass the ##EXTERNALTICKETID## from a ConnectWise integration to an email or some other escalation? In my use case, for a critical alert, LogicMonitor would create a new ticket in ConnectWise, but if the alert hasn't been acknowledged, I'd like to email an alert response team with both the LM alert ID & the CW ticket #. Additionally, it would be great if in the future I could pass that ticket number to another 3rd party integration so we could integrate with customer ticketing systems but keep our internal reference number throughout. It seems like all the integrations may use the same ##EXTERNALTICKETID## token, so maybe we could write it to a custom alert field or custom token? Thank you, Ryan Re: ##EXTERNALTICKETID## in Alert API Whoops, I had a mistake in there, i should've put .value, not .data in my previous post. For posterity, I also attempted the filter with both the URL format text & plain text in double quotes (in the example below), but I get an empty customColumns returned when the filter is before the customColumns (example 1). Conversely, I DO get data when I specify the customColumn before the filter, however the filter doesn't seem to apply (example 2). Example 1: GET /alert/alerts?filter=customColumns.name:"##externalticketid##",customColumns.value!-"no data"&customColumns=%2523%2523externalticketid%2523%2523 Example 2: GET /alert/alerts?customColumns=%2523%2523externalticketid%2523%2523&filter=customColumns.name:"##externalticketid##",customColumns.value!-"no data" Thank you! -Ryan Re: ##EXTERNALTICKETID## in Alert API The API call worked great for me, but is there any way to filter on alerts that contain data in the externalticketid column? I attempted to mimic the custom properties filtering examples, but it didn't seem to work. Thanks! GET /alert/alerts?filter=customColumns.name:%2523%2523externalticketid%2523%2523,customColumns.data!-"no data"&customColumns=%2523%2523externalticketid%2523%2523 Re: Radical Suggestion for Web Sites Fourthed! :)/emoticons/smile@2x.png 2x" title=":)" width="20">It would make my life easier as well. Re: Cisco Firepower data source Please add me as well. We have a number of Firepower deployments that we'd love to get API data from. Thank you! Re: Easier "exclude" filters Thanks for the screenshot Mike, that finally helped me understand. Unfortunately, for some reason I thought typing in the search bar on the right would allow the same exclusions or populate the filters or something. Once I clicked on the drop-down (for the device name in my case) it finally clicked. But just in case there's someone else like me that comes along, hopefully this will save a little time.
Top Contributions##EXTERNALTICKETID## available to pass to escalationsAPI Filtering InfoRe: Radical Suggestion for Web SitesRe: Cisco Firepower data sourceRe: ##EXTERNALTICKETID## in Alert APIRe: ##EXTERNALTICKETID## in Alert APIRe: Easier "exclude" filters