spaces kibana dashboards - juancamilocc/virtual_resources GitHub Wiki

Manage Dashboards in Kibana Using Spaces

In this guide, you will learn how to manage interactive dashboards in Kibana using spaces, ensuring granular permissions, logical separation, and effective log visualization.

Spaces in Kibana

Space Configuration

Create a Space

Log in to Kibana as an admin, navigate to Stack Management > Spaces and click on Create space, as follows.

Create Space

NOTE: Initially, we grant all permissions to the space, but these will be adjusted according to specific needs.

Switch to the new space by clicking on it, as follows.

Change to the New Space

Dashboard Configuration

Create a Visualize Library

To create a visualize library, go to Analytics > Visualize Library > Create visualization and select the Lens option.

Create a Visualize Library

Create Data View

In the Data view options, select Create a dataview. Give it a name, set an Index pattern that matches your data stream, and save it by clicking Save data view to Kibana, as shown below.

Create a Data View Create a Data View

Customizing a Visualize Library

In the filter bar, set kubernetes.namespace : "your_namespace". For Available fields, add kubernetes.container.name by clicking on +.

Customize Visualize Library

Next, click on Bar and change it to Table.

Customize Visualize Library

Click on Rows and adjust the Number of values as needed.

Customize Visualize Library Customize Visualize Library

Under Appearance, change the name field, enable the Directly filter on click option and save your changes.

Customize Visualize Library Customize Visualize Library

Create a Search

Navigate to Discover, select the Data View you created, add the message field and filter by kubernetes.namespace: "your_namespace", as follows.

Create Search

Save your search.

Create Search

Create Interactive Dashboards

Go to Dashboards > Create a dashboard. Click on Add from library, select Containers from Testing, adjust the table to fit the screen, and save it as Namespace Testing Containers.

Create Interactive Dashboard Create Interactive Dashboard

In another tab, create an additional dashboard and add the Visualize Namespace Testing Logs library, as shown below.

Create Interactive Dashboard

Click on Add panel > Links > Add link, set the link type to Dashboard, choose the Namespace Testing Containers dashboard, set the link text to Return to Namespace Testing Containers, and disable the other options.

Create Interactive Dashboard

Adjust the panel and save the dashboard as Visualize Namespace Testing Containers.

Create Interactive Dashboard

Return to the Namespace Testing Containers clicking on the panel. Click on the three-dot menu Create drilldown > Go to Dashboard, change the name for Check logs, in Choose destination dashboard set the another dashboard, disable Use filters and query from origin dashboard option and Create drilldown.

Create Interactive Dashboard Create Interactive Dashboard

Now, when you click on a specific container, a Check logs option will appear, redirecting you to the another dashboard to visualize the logs.

Create Interactive Dashboard Create Interactive Dashboard

Granular Permissions

Create a Role

Navigate to Stack Management > Security > Roles > Create role, referencing the logs-from-logstash-testing* indexes with read, view_index_metadata, and monitor privileges, as shown below.

Create Role

In the Aplication layer enable the following permissions as read-only.

Create Role Create Role

Create a User

Create a user associated with the role you just created and reporting_user. Go to Stack Management > Users > Create user.

Create User

Minimun Permissions for the Space

Navigate to Stack Management > Spaces > Edit space to assign the necessary permissions to your space and apply the changes.

Minimum Permissions to the Space

Check Space with Minimum Permissions

Log out as admin and log in using the user created above. Verify that the user only has access to dashboards and the reporting option as a read-only viewer.

Check Space Check Space

Conclusions

By leveraging Kibana Spaces, you can efficiently organize dashboards and visualizations, ensuring logical separation between environments or teams. Spaces, combined with granular roles and permissions, allow you to control access to sensitive data and dashboards, enhancing both security and usability. Interactive dashboards with drilldowns and links improve user experience, enabling seamless navigation and focused log analysis. This approach not only streamlines monitoring and troubleshooting but also supports compliance and operational best practices within your organization.