Splunk Search

How to set dynamic chart title without using Sideview Utils app?

Bhuavana
Explorer

Hi,

Could you please let me know how to set chart title dynamically without using Sideviewutils.

Tags (3)
0 Karma

somesoni2
Revered Legend

Here is one sample code for dynamic values from a text box.

<form>
  <label>DynamicChartTitle</label>
  <description>NULL</description>
  <fieldset autoRun="true" submitButton="true">    
    <input type="text" token="chartTitle" searchWhenChanged="true">
      <label>Chart Title</label>   
      <default>*</default>
    </input>    
  </fieldset>
  <row>
   <chart>
    <title>The chart tile is- $chartTitle$</title>
    <searchString>
      index=_internal source="*metrics.log"
      group=per_sourcetype_thruput 
      | timechart sum(kb) by series
    </searchString>
    <earliestTime>-1h</earliestTime>
    <latestTime>now</latestTime>
    <option name="charting.data.fieldShowList">
      ["splunkd_access", "splunkd"]
    </option>
    <option name="charting.chart">line</option>
  </chart>
  </row>
</form>

Bhuavana
Explorer

Im using Splunk 6.0

0 Karma

somesoni2
Revered Legend

What version of Splunk are you using?

0 Karma

Bhuavana
Explorer

yes i have it available in csv file.. or i can do a search to get the same from index?
please help me out with correct option to fetch in chart title

0 Karma

somesoni2
Revered Legend

If the value is not available in dashboard, how are you planning to provide the 'dynamic' value to the chart title? Is it stored somewhere?

0 Karma

Bhuavana
Explorer

Hi,

Thanks for the response. But in my case i dont have a text box at the top.

The value to dispaly in first panel which is not available in dasbaord. Let me know how to achieve the same. Sample code please..

0 Karma

ankireddy007
Path Finder

Hi,

You can use tokens in the title like $t_Bank$ and pass value form previous chart or filter:

 <table>
          <title>Top Errors for the Bank $t_Bank$ </title>
          <searchString> ....</searchString>
          <earliestTime> $earliest$ </earliestTime>
          <latestTime> $latest$ </latestTime>
          <option name="wrap">true</option>  
   </table>
0 Karma

Bhuavana
Explorer

so far i have not used filters for taking dynamic vlaues.. do u ahve any sample codes? plz share

0 Karma

ankireddy007
Path Finder

How you are going to get values dynamically? through filter?
Anyhow you are taking the filter value into token, so you can use that token as mentioned. Pls let me know if does not work

0 Karma

Bhuavana
Explorer

Ya thnx for the response.. It looks this is achieved using drilldown logic.. but my chart is going to be first one.. so in that case how to write using filter.. any sample code plz...

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...