Spread our blog

Splunk Dashboard Tags: Init

<init> tag is one of the most used tokens in the Splunk dashboard. If you are using the Splunk dashboard for a long time then you must have seen these in the Splunk dashboard. We use this token to load any token on the page load. Whenever the dashboard will load token defined within the init tag will load.

You can use event handlers tokens (<eval>, <set>, <unset>, <link>, <condition>) within this tag.

  • PDF scheduling is disabled for dashboards and forms that include an <init> element.
  • Token settings made within the <init> element override any settings made in URL query string parameters.
  • Token setting on page load is only supported for Simple XML dashboards.

Must Read:

Splunk Dashboard Child Elements: Eval

Splunk Child Elements: Set & Unset

Example:

Here from lines number 6 to 8, I have used the <init> tag, within that, I have set a token “app_name”, and the value of that token is defined as “my_app_name”. Then that token is passed to the below token.

Here is the dashboard.

Source Code:

<dashboard>
  <label>Init Tag</label>
  <search>
    <query>index=main app=$app_name|s$</query>
  </search>
  <init>
    <set token="app_name">my_app_name</set>
  </init>
  <row>
    <panel>
      <title>Activity Monitoring: $app_name$</title>
    </panel>
  </row>
</dashboard>

I hope this blog “Splunk Dashboard Tags: Init” will help you to gather more knowledge on Splunk dashboard tags.

Happy Splunking!!

What’s your Reaction?
+1
+1
+1
+1
+1
2
+1
+1

Spread our blog
You can also know about :  How to Customize a Dashboard using HTML in Splunk

LEAVE A REPLY

Please enter your comment!
Please enter your name here