Set predefined filters based on users's info


(Kenneth) #1

Hi,

I have created a visualization in Kibana which filters data based on the group_id field. Every user in kibana will have a group_id field in their metadata info. I would like to use this value to be used as the filter instead of the user manually setting this value every time they access the dashboard.

Is this possible in Kibana?

For example I have the following users and sales data

Users
{
"username": user-a,
"group_id": 1
},
User-B
{
"username": user-b,
"group_id": 2
}

Sales Data (index)
{
"sale_id": 001,
"sale_date": "2018-06-20",
"amount": 35.50,
"group_id": 1
},
{
"sale_id": 003,
"sale_date": "2018-06-20",
"amount": 3.90,
"group_id": 2
},
{
"sale_id": 001,
"sale_date": "2018-06-20",
"amount": 100.00
"group_id": 2
}

======

In my visual

user-a

Sale_Date (Month) | Total Sales
2018-01-01 (Jan) | 35.50

user-b
Sale_Date (Month) | Total Sales
2018-01-01 (Jan) | 103.90

====

thanks


(Christian Dahlqvist) #2

Using X-Pack Security and document level security, you can restrict access to subsets of documents based on user attributes as described in this blog post.


(Kenneth) #3

@Christian_Dahlqvist understood the topic of restricting access to data using document-level security access but what I would like to achieve is for each user accessing a visualization or dashboard (assuming the data set they are seeing are the ones they have access to) will have filter values applied based on their metadata info.

Assuming user-a and user-b both have access to the sales data (provided in previous post). I would like each user to see the filtered sales data that is more relevant to their group:

  • user-a sees sales data with group_id:1 by default
    (Then eventually user-a would be able change the filter say, group_id = 2)
  • user-b sees sales data with group_Id:2 by default
    (Then eventually user-b would be able change the filter say, group_id = 1)

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.