Now we want to set a href as default dashboard
set as following
<nav>
…
<collection label="Search">
<view name=“aaa” />
<a href="/app/abc/flashtimeline?q=search%20index=abc" default=“true”>Timeline</a>
<view name=“bob” />
</collection>
…
</nav>
but it still doesn’t works
Pls advise me how to set the href as the default dashboard
Seems like anchor tag will not support default attribute. Also name attribute is invalid for anchor tag. With this you can only use < view name="abc" default="true" />
In order to pass values as querystring by default to dashboard, following are your options based on your use cases:
Scenario 1
If you do not want users to see or modify values for index and query fields, you need to set them as token within a dummy search.
Add the following code in Simple XML using Source editor.
<!-- Dummy Search running without a query. Just to set default tokens -->
<search>
<query></query>
<preview>
<set token="q">search</set>
<set token="index">abc</set>
</preview>
</search>
Then use $q$ and $index$ later on in your query, which I think is already present in your existing Dashboard code.
Scenario 2
Only for Splunk 6.5
Splunk 6.5 has introduced <init> section in Simple XML Views which allows users to set default values on page load through token. Refer to Splunk 6.x Dashboard Examples for Set tokens on page load example.
<init>
<set token="index">abc</token>
<set token="q">search</token>
</init>
Scenario 3
If you want any of the values like index to be changed later on after first time load, you can add two new fields Dropdown (Dynamic with values defined by you) or Textbox (Dynamic with values set by user). Let me take dropdown example.
Next, select Default as abc
Similarly, Add new Dropdown for "Select Query"
Add Token as q
Check Search on Change.
Provide Static Name and Value as search
Finally, select Default as search.
In your existing dashabord you can continue to use $index$ and $q$ as the tokens which will be loaded with default values once the dashboard is loaded.
Disadvantage of 2nd approach is that two token fields will be visible to users.
Advantage could be that you can use Dynamic Options to provide list of indexes in case you need them.
Please try out and let me know if this helps, or if you need further assistance.
NOTE: In either of the above two approaches you will have to use view tag to set default dashboard in your navigation menu XML i.e. < view name="abc" default="true" />
You need href if you want to reference a dash from another app.
Which is what I want to do.
I have tried:
<a href="cars_twitter_analysis__test_app" default=“true”>Cars tweet analysis</a>
<a href="overview.html" default=“true”>Overview</a>
Etc, nothing seems to work.
I want to put in a link to the forwarder mgmt page:
"/manager/system/deploymentserver?t=2"
Thanks
I am trying to achieve something similar. I am trying to refer a Global Dashboard of APP1 into APP2 and APP3. I want to default the values of dashboard drop downs with different values for APP1, APP2 and APP3.
Did you got any solution for your case?
I was able to do it myself. Thanks!
Seems like anchor tag will not support default attribute. Also name attribute is invalid for anchor tag. With this you can only use < view name="abc" default="true" />
In order to pass values as querystring by default to dashboard, following are your options based on your use cases:
Scenario 1
If you do not want users to see or modify values for index and query fields, you need to set them as token within a dummy search.
Add the following code in Simple XML using Source editor.
<!-- Dummy Search running without a query. Just to set default tokens -->
<search>
<query></query>
<preview>
<set token="q">search</set>
<set token="index">abc</set>
</preview>
</search>
Then use $q$ and $index$ later on in your query, which I think is already present in your existing Dashboard code.
Scenario 2
Only for Splunk 6.5
Splunk 6.5 has introduced <init> section in Simple XML Views which allows users to set default values on page load through token. Refer to Splunk 6.x Dashboard Examples for Set tokens on page load example.
<init>
<set token="index">abc</token>
<set token="q">search</token>
</init>
Scenario 3
If you want any of the values like index to be changed later on after first time load, you can add two new fields Dropdown (Dynamic with values defined by you) or Textbox (Dynamic with values set by user). Let me take dropdown example.
Next, select Default as abc
Similarly, Add new Dropdown for "Select Query"
Add Token as q
Check Search on Change.
Provide Static Name and Value as search
Finally, select Default as search.
In your existing dashabord you can continue to use $index$ and $q$ as the tokens which will be loaded with default values once the dashboard is loaded.
Disadvantage of 2nd approach is that two token fields will be visible to users.
Advantage could be that you can use Dynamic Options to provide list of indexes in case you need them.
Please try out and let me know if this helps, or if you need further assistance.
NOTE: In either of the above two approaches you will have to use view tag to set default dashboard in your navigation menu XML i.e. < view name="abc" default="true" />
Edite my answer, added the option to do the same in Splunk 6.5 with the latest init section available on forms in Simple XML to set tokens on page load
Hi akdake,
If you need to put the search dashboard as the default dashboard of your App you don't need to use href, you can set the following line in your menu
<view name="search" default="true"/>
Bye.
Giuseppe
Hi, did you find an answer for this problem? I want to do the same thing.
Thanks
why you want to use href to launch a dashboard instead of
?
Bye.
Giuseppe
href can automatically passess some search parameters. so the search(index=abc sourcetype=abc) can be open quickly by clicking.
TKS.