Dashboards & Visualizations

Splunk table and drill down in Dashboard Studio

SplunkerNoob
Loves-to-Learn Lots

I have a Splunk table that has 3 rows and a count for each row. How do I make each value in table go to a different URL.  This is what I have but every row I click goes to that link. I want each table to go to a different link.

    "type": "splunk.table",
    "dataSources": {
        "primary": "ds_5ds4f5"
    },
    "title": "Device Inventory",
    "eventHandlers": [
        {
            "type": "drilldown.customUrl",
            "options": {
                "url": "https://device.com",
                "newTab": true
            }
        }
    ],
Labels (1)
0 Karma

SplunkerNoob
Loves-to-Learn Lots

I think it is working but unfortunately I get:

The URL you clicked cannot open as it is invalid and might contain malicious code. Change the URL to a relative or absolute URL, such as /app/search/datasets or https://www.splunk.com.

0 Karma

KendallW
Contributor

Hi @SplunkerNoob 

Assuming these are external URLs (not other dashboards/searches within Splunk), you can add the trusted domains to the drilldownUrlWhitelist setting in the web.conf file. 


@SplunkerNoob wrote:

I think it is working but unfortunately I get:

The URL you clicked cannot open as it is invalid and might contain malicious code. Change the URL to a relative or absolute URL, such as /app/search/datasets or https://www.splunk.com.


0 Karma

KendallW
Contributor

Hi @SplunkerNoob, first create a field in your search which contains the URLs, e.g. 

...
| eval target_url=case(
    device_type=="type1", "https://device1.com",
    device_type=="type2", "https://device2.com",
    device_type=="type3", "https://device3.com",
    1=1, "https://default.com"
)

 

Then in your dashboard:

<drilldown>
    <link target="_blank">{{row.target_url}}</link>
</drilldown>
0 Karma

KendallW
Contributor

Or with JSON:

{
    "type": "splunk.table",
    "dataSources": {
        "primary": "ds_5ds4f5"
    },
    "title": "Device Inventory",
    "eventHandlers": [
        {
            "type": "drilldown.customUrl",
            "options": {
                "url": "{{row.target_url}}",
                "newTab": true
            }
        }
    ]
}
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...