Dashboards & Visualizations

How to use a button,box,or link to load a report in a new window

DEADBEEF
Path Finder

I have a dashboard and at the top I would like to display a horizontal selection for the user, such that they can select report A, report B, or report C.  When they click it, it will open the report in a new window.

This can be accomplished through 3 checkboxes, radio buttons, HTML link, etc. I'm not sure how to do this.  I thought radio buttons, so I can start them all as unset, then when a user selects one, it unsets the other two and then opens a window with the report but am lost how to accomplish this.  Any pointers would be appreciated.

Labels (2)
Tags (1)
0 Karma
1 Solution

niketn
Legend

Ideally you should use a Link input (Radio and even Check Box should also work on similar lines)

Following is a snippet for Link Inputs which can serve as links to separate dashboards (you need to provide the dashboard path relative/absolute depending on your use case).


Please try out and confirm!

 

 

<dashboard>
  <label>Link Inputs</label>
  <row>
    <panel>
      <html depends="$alwaysHideCSSOverride$">
        <style>
          div[id^="link_"] button{
            width: 180px !important;
            background: rgb(92,192,92,1);
            padding: 10px;
            border-radius: 10px;
            color: white !important;
          }
        </style>
      </html>
      <input id="link_1" type="link" token="tokLink1" searchWhenChanged="true">
        <label></label>
        <choice value="link1">Link 1</choice>
        <change>
          <condition value="link1">
            <link target="_blank">yourLink1PathGoesHere</link>
            <unset token="form.tokLink1"></unset>
          </condition>
        </change>
      </input>
      <input id="link_2" type="link" token="tokLink2" searchWhenChanged="true">
        <label></label>
        <choice value="link2">Link 2</choice>
        <change>
          <condition value="link2">
            <link target="_blank">yourLink2PathGoesHere</link>
            <unset token="form.tokLink2"></unset>
          </condition>
        </change>
      </input>
      <input id="link_3" type="link" token="tokLink3" searchWhenChanged="true">
        <label></label>
        <choice value="link3">Link 3</choice>
        <change>
          <condition value="link3">
            <link target="_blank">yourLink3PathGoesHere</link>
            <unset token="form.tokLink3"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
</dashboard>

 

 

 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

Tags (1)

niketn
Legend

Ideally you should use a Link input (Radio and even Check Box should also work on similar lines)

Following is a snippet for Link Inputs which can serve as links to separate dashboards (you need to provide the dashboard path relative/absolute depending on your use case).


Please try out and confirm!

 

 

<dashboard>
  <label>Link Inputs</label>
  <row>
    <panel>
      <html depends="$alwaysHideCSSOverride$">
        <style>
          div[id^="link_"] button{
            width: 180px !important;
            background: rgb(92,192,92,1);
            padding: 10px;
            border-radius: 10px;
            color: white !important;
          }
        </style>
      </html>
      <input id="link_1" type="link" token="tokLink1" searchWhenChanged="true">
        <label></label>
        <choice value="link1">Link 1</choice>
        <change>
          <condition value="link1">
            <link target="_blank">yourLink1PathGoesHere</link>
            <unset token="form.tokLink1"></unset>
          </condition>
        </change>
      </input>
      <input id="link_2" type="link" token="tokLink2" searchWhenChanged="true">
        <label></label>
        <choice value="link2">Link 2</choice>
        <change>
          <condition value="link2">
            <link target="_blank">yourLink2PathGoesHere</link>
            <unset token="form.tokLink2"></unset>
          </condition>
        </change>
      </input>
      <input id="link_3" type="link" token="tokLink3" searchWhenChanged="true">
        <label></label>
        <choice value="link3">Link 3</choice>
        <change>
          <condition value="link3">
            <link target="_blank">yourLink3PathGoesHere</link>
            <unset token="form.tokLink3"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
</dashboard>

 

 

 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Tags (1)

DEADBEEF
Path Finder

I have never heard of link inputs before!  Can you share a docs/page I can reference to read up more on these?  This worked perfectly!

0 Karma

DEADBEEF
Path Finder

@niketn - can you test this on 7.3.x?  I tried this on 7.3.3 and it doesn't seem to work.

Tags (1)
0 Karma

niketn
Legend

@DEADBEEF what do you mean by not working? The link input behaviour or CSS Style override to make it appear as button?

There is a know issue and fix fir CSS Style override from Simple XML dashboard code. Please refer to answer  https://community.splunk.com/t5/Dashboards-Visualizations/How-to-include-CSS-in-Dashboards-with-the-...

Do upvote the answer/comments that helped.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

DEADBEEF
Path Finder

Ahh okay, putting <p/> before the <style> fixed it!  Thank you.  Maybe edit your answer to use that for the affected versions of splunk?

0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...