Restrict the Visibility of Monitoring Data
The Data Filter allows you to restrict the visibility of monitoring data and is configured via the setting Data_Filter.
Administrators can use this filter to control which data records are accessible to specific users based on their attributes.
A base filter (baseFilter) can be used to define which data is displayed by default.
In addition, visibility can be extended through specific filter rules based on organizational affiliation, roles, permissions, or users.
These session-specific rules can be linked using a UND or ODER link.
User attributes can be created and viewed in the Identity Manager.
Default configuration of Data_Filter
The default configuration of the Data Filter is as follows:
{
"organisations": {
"org1": [
{
"bool": {
"must": [
{
"match_all": {}
}
],
"must_not": []
}
}
]
},
"roles": {
"role1": [
{
"bool": {
"must": [
{
"match_all": {}
}
],
"must_not": []
}
}
]
},
"rights": {
"right1": [
{
"bool": {
"must": [
{
"match_all": {}
}
],
"must_not": []
}
}
]
}
}
|
An incorrect configuration will prevent data from being loaded into the monitor. |
Procedure:
First, a base filter (baseFilter entry in the data_filter JSON setting) can be set.
This controls what is generally allowed to be viewed.
If no base filter is set, all entries are displayed unless other session-based rules are active. If session-based rules are set, only those are taken into account. By default, no base filter is set.
After that, data visibility is further expanded for specific organizations (organisations), roles (roles), or permissions (rights).
Boolean queries are used to configure visibility settings.
This allows you to create queries using must and must_not that return results from the monitor to be displayed.
The Boolean queries include the following types:
-
must: The value must be present -
must_not: The value must not be present
Examples for the baseFilter
Completely restrict visibility
Here, the visibility of the data is completely restricted.
If no further settings have been configured for organizations, roles, or permissions, no data will initially be displayed in the monitor.
The match_all query returns all data, but using the must_not filter excludes all matches.
As a result, no data is returned.
{
"baseFilter": [
{
"bool": {
"must_not": [
{
"match_all": {}
}
],
"must": []
}
}
]
}
|
The examples represent excerpts from the configuration and should not be used on their own. |
Partially Restricting Visibility
Example 1
In the following example of a monitor with project data, the goal is to ensure that only public projects are displayed by default.
To do this, the project must contain the value "public" in the "visibility" column.
{
"baseFilter": [
{
"bool": {
"must": [
{
"term": {
"visibility": "public"
}
}
]
}
}
]
}
Example 2
If certain data based on a pattern is to be visible by default, a wildcard can be used in the query.
In the following example of a monitor with product data, products with a specific name prefix are to be displayed.
{
"baseFilter": [
{
"bool": {
"must": [
{
"wildcard": {
"product_name": "prefix_*"
}
}
]
}
}
]
}
Example 3
If the visibility of the data is to be time-limited by default, this can be implemented as follows.
{
"baseFilter": [
{
"bool": {
"must": [
{
"range": {
"timestamp": {
"gte": "now-7d/d",
"lte": "now/d"
}
}
}
]
}
}
]
}
Examples of organizations, roles, and permissions
Extending visibility
Boolean queries are also used to remove visibility restrictions for specific user attributes.
For example, if users with the "bpcadmin" role are to be able to view all data, this can be configured at roles using match_all.
{
"roles": {
"bpcadmin": [
{
"match_all": {}
}
]
}
}
If the baseFilter has been configured so that, for example, only data from the last 7 days is displayed by default and users with the "analyst" role are to have extended access rights to data from the last 30 days, this can be implemented for the role as follows.
{
"roles": {
"analyst": [
{
"bool": {
"must_not": [],
"must": [
{
"range": {
"timestamp": {
"gte": "now-30d/d",
"lte": "now/d"
}
}
}
]
}
}
]
}
}
Using the Data Filter Operator
The Data Filter Operator (UND / ODER) specifies how multiple filter conditions are combined.
This affects how the visibility of monitor data is controlled.
ODER Operator (Default)
-
At least one of the conditions must be true.
-
Used to display more data.
Example: Users with role="analyst" and organisation="virtimo" see all data that meets either visibility="public" or product_name="virtimo_*" (or both).
{
"roles": {
"analyst": [
{
"bool": {
"must_not": [],
"must": [
{
"term": {
"visibility": "public"
}
}
]
}
}
]
},
"organisations": {
"virtimo": [
{
"bool": {
"must_not": [],
"must": [
{
"wildcard": {
"product_name": "virtimo_*"
}
}
]
}
}
]
}
}
UND -Operator
-
All conditions must be met.
-
Used to define stricter restrictions.
Example: Users with role="analyst" and organisation="virtimo" see only the data that meets both visibility="public" and product_name="virtimo_*".
Note:
Only the rules that apply to the user are active at any given time.
Therefore, in a UND link, not all defined rules are necessarily combined—only those that apply to the user.
In the example above: If a user only has the role analyst but is not part of the organization virtimo, then only the filter rule for the role is active.
Despite the UND link, it is sufficient in this case that visibility="public" applies.
Interaction Between the Base Filter and the Filter Operator
Note: The filter operator applies only to session-specific filter rules.
Data accessible via the base filter remains visible even with a UND link.
-
With a
UNDlink, an entry is visible if it is accessible via the base filter or by all session-specific rules. -
With an
ODERlink, an entry is visible if it is permitted by the base filter or by at least one session-specific rules.
Dynamic Filter Values
Within organisations, roles, and rights, dynamic filters "#" can be created.
If one exists, the filter is created within the block for each organization / role / permission, and the filter value is replaced with a name.
-
#this.name#: Replaces the filter value with the name of the organization, role, or permission. -
#user.loginName#: Replaces the filter value with the login name of the logged-in user
Example: #this.name#
An account is assigned to the following roles: "Projects," "Marketing," and "CRM". To make all data relevant to these roles visible, the dynamic filter can be applied.
{
"roles": {
"#": [
{
"bool": {
"must_not": [],
"must": [
{
"term": {
"unit": "#this.name#"
}
}
]
}
}
]
}
}
This makes all data visible where the “unit” column contains the names of the assigned roles (“Projects,” “Marketing,” “CRM”). If a new role is added or a role is removed, the filter no longer needs to be adjusted.
Example: #user.loginName#
Using the placeholder #user.loginName#, you can dynamically integrate the current user’s login name into the query.
The following example combines a global placeholder for all roles (#) with precise filtering so that only data for which the user’s own account is listed as the creator (originator.raw) is visible.
{
"roles": {
"#": [
{
"bool": {
"must": [
{
"term": {
"originator.raw": "#user.loginName#"
}
}
],
"must_not": []
}
}
]
}
}
|
When creating filter rules, the underlying data types of the OpenSearch indices must be taken into account.
Use these explicit suffixes for exact matches ( |