To embed a Grafana dashboard using an iframe in a Splunk dashboard, you’ll first need to get the embeddable URL for the Grafana dashboard, and then create an HTML panel in your Splunk dashboard with an iframe that points to the Grafana URL.
Here’s a step-by-step guide:
- Get the Grafana embed URL:a. Open your Grafana dashboard.
b. Click on the “Share” button located at the top of the dashboard.
c. In the “Share” panel, switch to the “Embed” tab.
d. Enable the “Current time range” option if you want the embedded dashboard to reflect the time range set in Grafana.
e. Enable the “Template variables” option if you want to include the current template variable values in the embedded dashboard.
f. Copy the iframe embed code, which will include a URL similar to:
https://<your_grafana_url>/d-solo/<dashboard_id>/<dashboard_name>?orgId=<organization_id>&<other_parameters>
- Add an iframe to your Splunk dashboard:a. Open your Splunk dashboard or create a new one.
b. Click on “Edit” to switch to the dashboard editing mode.
c. Click on “Add Panel” and choose “HTML” from the list of panel types.
d. In the “HTML Source” field of the new HTML panel, paste the iframe embed code you copied from Grafana. It should look like this:
php<iframe src="https://<your_grafana_url>/d-solo/<dashboard_id>/<dashboard_name>?orgId=<organization_id>&<other_parameters>" width="100%" height="300" frameborder="0"></iframe>
e. Customize the width and height attributes of the iframe to fit your Splunk dashboard layout. For example, you can set the width to “100%” to make the iframe take up the full width of the panel, and adjust the height as needed.
f. Save the HTML panel and exit the dashboard editing mode by clicking “Done.”
Now your Grafana dashboard should be embedded in your Splunk dashboard using an iframe. Please note that both Splunk and Grafana should be accessible from the same network to display the embedded dashboard properly. If you encounter any issues related to CORS (Cross-Origin Resource Sharing) or authentication, you may need to adjust the settings in Grafana to allow embedding in iframes from the Splunk domain.