Dashboards & Visualizations

URL in dashboard

nandipatisunil
Path Finder

I have a text which is a URL. I am grouping my results and showing in a dashboard.

sourcetype="xyz" | stats count by AppName, URL

Now when I click on the URL, i want it to redirect to that specific URL page either in the same or new window.
How do I mention the link in my XML?

Lets say I have www.google.com on my URL field value ... when i click it ... i want google to be opened.

Tags (4)
0 Karma

aelliott
Motivator

Well here is how i did it through Javascript
I simply use jquery .on to say if what they clicked on in the detail table is myfirstfield, then open the value which is the URL etc, i use Window.Open and pass a name of the window so they don't open a million popups.

splunkjs.mvc.Components.getInstance("example-table-detail").on("click", function (e) {
if(e.field === "Values"){

if(e.data["click.value"] === "MyFirstField")  
{
    if(e.data["click.value2"] != "" && e.data["click.value2"] != null ){
    window.open(e.data["click.value2"],"NameOfWindow");}
}

if(e.data["click.value"] === "MySecondField"){
    if(e.data["click.value2"] != "" && e.data["click.value2"] != null ){
    window.open(e.data["click.value2"],"NameOfWindowTwo");}
}

}
 });

jtrucks
Splunk Employee
Splunk Employee

You may have to look at using the API to build your own dashboard with clickable links like that. Any of the SDK options or the REST API will do that quite nicely for you.

--
Jesse Trucks
Minister of Magic
0 Karma

aelliott
Motivator

posted an example above

0 Karma

nandipatisunil
Path Finder

Thanks jtrucks.
aelliott ... can you give me more info.

0 Karma

jtrucks
Splunk Employee
Splunk Employee

You should answer in more detail as a separate answer to help the original poster!

--
Jesse Trucks
Minister of Magic
0 Karma

aelliott
Motivator

I have this functionality in an app I just created. I used SplunkJS to accomplish using the Web Framework, you can intercept the click and call javascript to open a new window.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...