- Revenera Community
- :
- Usage Intelligence
- :
- Usage Intelligence Knowledge Base
- :
- Global Filters in API Reporting
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Global Filters in API Reporting
Global Filters in API Reporting
Most of the available filter properties are string-based. This means that when applying a filter, the requested field can be represented as a string, stringArray or regex. There are also some filters which are numeric. These filters should be represented as number or numberRange.
- String-Based Filters
- Numeric Filters
- Date Range Filters
- Boolean Filters
- Special Filters
- <NULL> Values in Global Filters (Date-Range Reports)
String-Based Filters
The following properties are stored as strings:
machineId *
clientId *
prodVersion
prodEdition
prodBuild
prodLanguage
licenseType
formFactor *
osLanguage
osWordLength *
cpuType *
dotNetVersion *
javaVersion *
javaVendor *
javaRuntime *
javaGraphics *
javaVmVersion *
javaVmName *
vm *
C01 .. C20 (Custom properties)
licenseKey *
NOTE: licenseKey requires a special user permission to be used as a filter.
NOTE: Properties marked with an asterisk (*) are based on the current (latest known) values.
The type field in the above filters needs to be string, stringArray or regex. A value field is always required. The contents of this field should be according to the specified type.
- If string is specified, then the value field must contain a single string that needs to be matched precisely with the stored data.
- If stringArray is specified, then the value field must contain an array of strings where one of which needs to match precisely with the stored data.
- If specifying a regex, the value field should contain a string which is treated as a regular expression and the stored data will be matched against it using regular expression rules.
Example Filter Using a String Value
In this example, the product build value needs to be exactly “3014.int-12214”:
{
"prodBuild":
{
"type": "string",
"value": "3014.int-12214"
}
}
Example Filter Using a String Array
In this example, the product build value needs to be either “3014.int-12214”, “3017.enx-57718”, or “4180.vrx-81059”. Note that since the type is declared as stringArray, the value field needs to contain an array. Consider all elements in the array to have an OR logical expression between them.
{
"prodBuild":
{
"type": "stringArray",
"value": ["3014.int-12214", "3017.enx-57718", "4180.vrx-81059"]
}
}
Example Filter Using a Regular Expression
In this example, the product build value needs to start with “30” and end with “18” whilst having 10 characters in between:
{
"prodBuild":
{
"type": "regex",
"value": "^30.{10}18$"
}
}
Numeric Filters
The following properties are stored as numeric values:
cpuCores *
displayCount *
ram *
resolutionWidth *
resolutionHeight *
lifetimeRuntimeMinutes *
lifetimeSessionCount *
screenPpi *
javaVmRam *
NOTE: Properties marked with an asterisk (*) are based on the current (latest known) values.
The type field in the above filters needs to be number or numberRange.
- If number is specified, then a value field must also be present. The value field should contain a number, which may contain a decimal point if required.
- If numberRange is specified, then the value field should NOT be used. Instead, the properties min and max are to be used. These refer to the minimum and maximum number to be included in the report. If only one limit needs to be set, the other property is to be left out. Therefore, if you want to include installations with up to 2 display devices, you would not specify a min value, but instead specify only a max and set it as 2.
Example Filter Using a Number Value
In this example, the number of display devices needs to be exactly 3:
{
"displayCount":
{
"type": "number",
"value": 3
}
}
Example Filter Using a Number Range Value
In this example, the RAM needs to be between 1025MB and 4096MB (both included):
{
"ram":
{
"type": "numberRange",
"min": 1025,
"max": 4096
}
}
Date Range Filters
The following properties are stored as dates:
dateInstalled
dateLastSeen
The type field in the above filters needs to be date or dateRange.
- If date is specified, then a value field must also be present. The value field should contain a date.
- If dateRange is specified, then the value field should NOT be used. Instead, the properties min and max are to be used. These refer to the minimum and maximum dates to be included in the report. If only one limit needs to be set, the other property is to be left out.
In the following example, users installed after January 1st 2018 are to be shown:
{
"dateInstalled":
{
"type": "dateRange",
"min": "2018-01-01"
}
}
Note that all dates must be in ISO 8601 format.
Boolean Filters
The following property is stored as boolean:
touchScreen
The type field in the above filters needs to be boolean. The value must be true or false.
In the following filter, clients with a touch screen are being requested.
{
"touchScreen":
{
"type": "boolean",
"value": true
}
}
Special Filters
Some filters need to be represented in a special format due to their unique requirements. These special filters are:
Special Filter: licenseStatus
The licenseStatus filter is made up of 4 sub-values: activated, blocked, expired and allowed. These are presented as boolean values.
Unlike other filters, this filter is presented as an array of JSON objects. Each object can contain a subset (or all) of these 4 boolean values.
Consider the following example. In this example, for a client to be included, the license has to either be activated AND allowed, or else it can be not allowed AND expired. In other words, ( (activated AND allowed) OR ((NOT)allowed AND expired) ).
{
"licenseStatus":
[
{
"activated": true,
"allowed": true
},
{
"allowed": false,
"expired": true
}
]
}
Special Filter: os
The os filter is made up of 3 granularity levels. These are platform, version, and edition. These are meant to split the OS name into levels of detail as required by the user. Consider the following:
- platform: Microsoft Windows
- version: Microsoft Windows 7
- edition: Microsoft Windows 7 Professional
If a filter is set on the version “Microsoft Windows 7”, the result would include all editions of Windows 7. One or more of these granularity levels may be specified. If more than 1 granularity level is specified, the values are ORed together.
In the following example, all editions of “Microsoft Windows 7” are included, and also “Microsoft Windows Vista Home Premium”:
{
"type": "string",
"version": "Microsoft Windows 7",
"edition": "Microsoft Windows Vista Home Premium"
}
In the following example, the type is stringArray. Note that an array needs to be passed if the type is set as such, even if it is to contain only 1 element. In this case, the version can be either “Microsoft Windows 7” or “Microsoft Windows 8” (which are ORed together). Also, clients running on “Microsoft Windows XP Professional” are to be included.
{
"type": "stringArray",
"version": ["Microsoft Windows 7", "Microsoft Windows 8"],
"edition": ["Microsoft Windows XP Professional"]
}
Special Filter: geography
The geography filter is made up of 3 granularity levels. These are continent, country, and usState.
The usState value applies only to United States. Continents and countries are presented in 2-letter codes. Countries follow ISO standard 3166-1 alpha-2. US states are presented in ISO 3166-2:US format.
In the following example, the clients have to be either:
- In the continents Asia or Oceania
- In the country Germany
- In the US states New York, New Jersey, or Kansas
{
"type": "stringArray",
"continent": ["AS", "OC"],
"country": ["DE"],
"usState": ["US-NY", "US-NJ", "US-KS"]
}
IMPORTANT: In this filter, the type can be string or stringArray. Regular expressions are not supported in geography filters.
Special Filter: gpu
The gpu filter is made up of 2 granularity levels. These are vendor and model. Both are represented as string values.
In the following example, the clients have to have a GPU:
- From the vendors NVIDIA or Intel
- With the model AMD Radeon HD 4600
{
"type": "stringArray",
"vendor": ["NVIDIA", "Intel"],
"model": ["AMD Radeon HD 4600"]
}
Special Filters: optOut and backOff
The opt-out mechanism was introduced in SDK version 5.1.0. With this feature, vendors can have their application report to the Usage Intelligence servers that a user does not want to be tracked. Using this property, vendors can filter out installations that were opted-out.
Similarly, backoff filtering was introduced with version 5.0.0. Backoff is when a product account runs over-quota and the server starts rejecting data. Although filtering for backed-off installations was introduced with version 5, it was also backported to previous versions. However, when a new installation with an SDK prior to version 5 tries to register with the server and is rejected, it is not marked as being once backed-off when it is eventually accepted by the server. With version 5 onwards, the server flags an installation as being historically backed-off in such cases.
Both backOff and optOut filters are made up of 2 boolean sub-values: historical and current.
- The historical value refers to installations that were once backed-off or opted-out. These may include installations that are still currently backed-off or opted-out.
- The current value refers to the status during the last time that the client called the server.
Therefore, if an installation was opted-out yesterday but got opted-in today, it will be marked as historically opted-out but not currently opted-out.
In the following example, for a client to be included, the optOut status has to either be historical AND not current, or else it can be not historical (i.e. users have to be currently opted-in but used to be opted-out at some point or never opted out).
{
"optOut":
[
{
"historical": true,
"current": false
},
{
"historical": false
}
]
}
Special Filter: lifetimeEventUsage
Using lifetime event usage filters, clients can be filtered based on whether a particular event or set of events occurred or not within the client’s lifetime. Alternatively, one can set a filter based on the number of times an event has occurred.
In the following example, clients that are included must have done the “File Operations - Open” event at least 5 times to be counted.
{
"category": "File Operations",
"name": "Open",
"min": 5
}
In the following example, clients must have done either “File Operations - Open” or “File Operations - Save” for a combined total of between 10 to 50 times.
{
"combiArray": [
{
"categoryType": "string",
"nameType": "string",
"category": "File Operations",
"name": "Open"
},
{
"categoryType": "string",
"nameType": "string",
"category": "File Operations",
"name": "Save",
}
],
"min": 10,
"max": 50
}
In the following example, clients must have done any event within the “File Operations” category for a combined total of not more than 100 times. This is done using a regular expression in the name.
{
"combiArray": [
{
"categoryType": "string",
"nameType": "regex",
"category": "File Operations",
"name": ".*"
}
],
"max": 100
}
Special Filter: reachOutDeliveries
Using ReachOut delivery filters, clients can be filtered based on whether a particular ReachOut message or a combination of ReachOut messages were delivered or not within the client’s lifetime.
The filter consists of a JSON array that includes one or more objects. Each object is a combination of delivered and undelivered campaigns, and the different combinations are ORed together. Therefore, it is possible to show users that either received ReachOut message 1 but not 2, or else received 3 but not 4 as in the following example.
In the following example, we are looking for clients who either received campaign 1 but not 2, OR received campaign 2 but not 3.
[
{"auto": {"delivered": ["1"], "undelivered":["2"]}},
{"auto": {"delivered": ["2"], "undelivered":["3"]}}
]
The above example contains only “auto” ReachOut campaigns. Manual campaigns can be specified using “manual” instead of “auto” as in the above example. Each object can contain a mix of “auto” and “manual” campaigns.
<NULL> Values in Global Filters (Date-Range Reports)
Most of the available properties can include null values. There are different reasons why a value would be null. When these are properties that are set by the application, the possible reasons why a value would be null are: cases where the value has not been set by the application (such as prodBuild never being set), and cases where values are set to an empty string (“”) or to a string containing “<NULL>”.
One other reason is that although these values have been set, the SDK has not yet had time to sync with the servers to provide this new information.
In cases where the properties are set automatically such as hardware or OS related information, the values would be null if the SDK failed to retrieve that value from the OS or if the server failed to identify the value retrieved by the SDK.
Other reasons include cases where Java version is requested from an application that does not use the Java SDK, US state is requested for users who are not running within the US, etc.
The following are the properties that support null values:
prodVersion
prodEdition
prodBuild
prodLanguage
machineId
formFactor
vm
cpuType
cpuCores
ram
resolutionWidth
resolutionHeight
javaVersion
javaVmVersion
javaVmName
javaVendor
javaRuntime
javaGraphics
osLanguage
licenseKey
C01 .. C20 (Custom properties)
os
geography
gpu
Null values can be requested either on their own or as part of a filter containing other values.
The following example would return only cases where the prodVersion is null:
{
"prodVersion":
{
"includeNull": true
}
}
The following example would return cases where the prodVersion is either 1.1, 1.2 or null:
{
"prodVersion":
{
"type": "stringArray",
"value": ["1.1", "1.2"],
"includeNull": true
}
}
By default, when specifying a filter, null values would not be included. Therefore, in the following example, only clients with prodVersion set to 1.1 or 1.2 will be included, while null values are excluded:
{
"prodVersion":
{
"type": "stringArray",
"value": ["1.1", "1.2"]
}
}
However, if no filter is specified, then nulls are included by default. Therefore, if you want to include any value of prodVersion as long as it is not null, a prodVersion filter needs to be included as follows:
{
"prodVersion":
{
"type": "regex",
"value": ".*",
"includeNull": false
}
}
In the case of filters that use sub-properties (os, geography, and gpu), the includeNull filter is to be included in the sub-property and applies to that specific sub-property only. In order to be able to include the includeNull property, instead of providing the value as a string or an array of strings, the value of the sub-property must be a JSON object that contains a property named “value”, and another named “includeNull”. Each of these properties is optional, but at least one of them must be present.
In the case of geography, this has a very particular meaning. Requesting for null “country” value does not return all cases where the country could not be retrieved, but only cases where the continent could be retrieved but the country could not. Similarly, requesting null “usState” returns cases where the continent and country could be retrieved but the US state could not. This does not include clients that are not situated in the US. If you are interested in finding clients where we could not detect any geographical data, the includeNull filter needs to be applied in the continent sub-property.
In the following example, we are requesting cases where we know that the client is within the US but the state could not be identified:
{
"geography":
{
"type": "string",
"country": "US",
"usState":
{
"includeNull": true
}
}
}
In the following example, we are requesting cases where the GPU is either “NVIDIA”, “AMD” or null (unidentified):
{
"gpu":
{
"type": "stringArray",
"vendor":
{
"value": ["NVIDIA", "AMD"],
"includeNull": true
}
}
}