Dashboards & Visualizations

Using intentions in Static html page.

sanju005ind
Communicator

I am using StaticContentSample module to display text on a panel in a view. How do I go about making the text "clickable".For example if I click on the word DNS I should get sourcetype="DNS" in the Searchbar and If I click DHCP then should get sourcetype="DHCP". Please help this is urgent.

Tags (1)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

If you're using static content, you can't use intentions. Those are only applicable in Splunk UI XML. You could use an HTML form to construct a URL like:

flashtimeline?q=search%20sourcetype%3D"DHCP"

where flashtimeline is the name of the view you want to display in (it is relative to the current view in the current app), and the value of q is simply the URL-encoding of search sourcetype="DHCP" or whatever. If you use an HTML form with method GET and send a field with the value search sourcetype="whatever", the form submission will automatically URL encode, or you can call the javascript encode() function yourself to construct the URL, or you can simply pre-encode it in the static text.

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

If you're using static content, you can't use intentions. Those are only applicable in Splunk UI XML. You could use an HTML form to construct a URL like:

flashtimeline?q=search%20sourcetype%3D"DHCP"

where flashtimeline is the name of the view you want to display in (it is relative to the current view in the current app), and the value of q is simply the URL-encoding of search sourcetype="DHCP" or whatever. If you use an HTML form with method GET and send a field with the value search sourcetype="whatever", the form submission will automatically URL encode, or you can call the javascript encode() function yourself to construct the URL, or you can simply pre-encode it in the static text.

gkanapathy
Splunk Employee
Splunk Employee

add querystring parameters for "earliest_time" and "latest_time"

0 Karma

sanju005ind
Communicator

However the time range defaults to Alltime.How can I change that.

0 Karma

sanju005ind
Communicator

Thanks Kanapathy.It works for me.

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...