Splunk Search

How to create hyperlink that directs to search query on Splunk dashboard?

REACHGPRAVEEN
Explorer

it should look like below 2 

search by employeeid(hyperlink)

search by app(hyperlink)

once clicked on above  hyperlinks it should open new search with search query

index = x  | search employeeid =123

index= x | search app = abc

@scelikok  @woodcock

Please help on this. Thanks in advance

Labels (2)
Tags (1)
0 Karma

tscroggins
Influencer

@REACHGPRAVEEN 

Assuming a base URL of https://splunk:8000/en-us/app/search, i.e. the search app on your Splunk search head, you can construct basic search URLs with the earliest, latest, and q query parameters:

https://splunk:8000/en-US/app/search/search?earliest=-24h%40h&latest=now&q=search%20index%3Dx%20employeeid%3D123 

https://splunk:8000/en-US/app/search/search?earliest=-24h%40h&latest=now&q=search%20index%3Dx%20app%3Dabc 

Basic URL encoding rules apply.

0 Karma

renoyzac
Observer

@tscroggins @REACHGPRAVEEN I'm facing a similar requirement. I tried appending my query to the q=search parameter as follows:

 

https://splunksearch.com/en-US/app/search/search? q=search index=xyz sourcetype=xyz

 

However, it only opens the Splunk Search window, the search query is not copy pasted in the search window. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The URL should be encoded e.g. spaces should be replaced by %20

https://splunksearch.com/en-US/app/search/search?q=search%20index=xyz%20sourcetype=xyz
0 Karma

renoyzac
Observer

That worked. Thank you 🙂 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...