Splunk Search

display the dropdown content as Chart title

harshal_chakran
Builder

Hi,

I am using a xml code for showing a dropdown as follows:-

alt text

I want to display the content of dropdown, i.e.DataCall or Datarecieve as the title of the chart. And it should change as per the selection of dropdown.

Sorry I was not able to put the code directly, so I am attaching an image of it.

Please Help

somesoni2
Revered Legend

Just used $dropdowntokenname$ in place of title text. Example:

<form>
  <label>DynamicChartTitle</label>
  <description/>
  <fieldset autoRun="true" submitButton="true">
    <input type="time" searchWhenChanged="true">
      <default>
        <earliestTime>-15m</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
    <input type="dropdown" token="sourcetype" id="field3">
      <label>sourcetype :</label>
      <default>*</default>
      <choice value="*">All</choice>
      <populatingSearch fieldForValue="sourcetype" fieldForLabel="sourcetype">
        <![CDATA[ index=_internal | stats count by sourcetype | fields sourcetype]]>
      </populatingSearch>
    </input>
  </fieldset>
  <row>
    <chart>
      <title>DefaultTitle- $sourcetype$</title>
      <searchString>index=_internal | stats count by sourcetype</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
    </chart>
  </row>
</form>

somesoni2
Revered Legend

You can use your token user1 everywhere, you don't have to define another token for same value. Hope this is what you are asking here.

0 Karma

harshal_chakran
Builder

Hi,
Thanks for the reply somesoni2.
I have already define one token, as shown above i.e."user1", which I am using in a searchstring. Is it possible to define another token for the choice content?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...