Splunk Search

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

Explorer

Hi,

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

Tags (3)
0 Karma

SplunkTrust
SplunkTrust

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>

Explorer

Im using Splunk 6.0

0 Karma

SplunkTrust
SplunkTrust

What version of Splunk are you using?

0 Karma

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

SplunkTrust
SplunkTrust

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

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

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

Explorer

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

0 Karma

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

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