Splunk Search

Why am I having a problem in tokens when using customviz app from splunkbase?

patricianaguit
Explorer

Hi, I tried to use bubble chart from custom viz app that i downloaded on splunk base. The code works if i specify the values in search area inside the "data-options". However, every time i include token using "$$" like what ive read in other questions, the code will not work all of sudden. Can someone help me out?

Below is my code

  <form script="autodiscover.js">
      <label>BubbleChart_Trial1_customvizapp</label>
        <fieldset submitButton="false">
        <input type="time" token="time_token">
          <label>Time</label>
          <default>
            <earliest>0</earliest>
            <latest></latest>
          </default>
        </input>
        <input type="multiselect" token="status_token" searchWhenChanged="true">
          <label>Status</label>
          <choice value="*">All</choice>
          <prefix>(</prefix>
          <suffix>)</suffix>
          <valuePrefix>Status="</valuePrefix>
          <valueSuffix>"</valueSuffix>
          <delimiter> OR </delimiter>
          <fieldForLabel>Status</fieldForLabel>
          <fieldForValue>Status</fieldForValue>
          <search>
            <query>sourcetype=management_sampledata_csv 
    | stats count by "Status"</query>
            <earliest>0</earliest>
            <latest></latest>
          </search>
        </input>
        <input type="multiselect" token="ticket_token" searchWhenChanged="true">
          <label>Ticket Type</label>
          <choice value="*">All</choice>
          <prefix>(</prefix>
          <suffix>)</suffix>
          <valuePrefix>"Ticket Type"="</valuePrefix>
          <valueSuffix>"</valueSuffix>
          <delimiter> OR </delimiter>
          <fieldForLabel>TicketType</fieldForLabel>
          <fieldForValue>TicketType</fieldForValue>
          <search>
            <query>sourcetype=management_sampledata_csv 
     $status_token$  | rename "Ticket Type" as TicketType
    | stats count by "TicketType"</query>
            <earliest>0</earliest>
            <latest></latest>
          </search>
        </input>
        <input type="multiselect" token="priority_token" searchWhenChanged="true">
          <label>Priority</label>
          <choice value="*">All</choice>
          <prefix>(</prefix>
          <suffix>)</suffix>
          <valuePrefix>Priority="</valuePrefix>
          <valueSuffix>"</valueSuffix>
          <delimiter> OR </delimiter>
          <fieldForLabel>Priority</fieldForLabel>
          <fieldForValue>Priority</fieldForValue>
          <search>
            <query>sourcetype=management_sampledata_csv  $status_token$ $ticket_token$
    | stats count by "Priority"</query>
            <earliest>0</earliest>
            <latest></latest>
          </search>
        </input>
      </fieldset>
      <row>
        <panel>
          <html>
               <h2>Time Spent per Category(Per User)</h2>
                 <div id="bubbleSearch1" class="splunk-manager" data-require="splunkjs/mvc/searchmanager" data-options="{ "search": "sourcetype=management_sampledata_csv  $$status_token$$ $$ticket_token$$ $$priority_token$$  | stats count(\"Ticket Type\") as CountTicketType by \"Ticket Type\"| eventstats sum(CountTicketType) as Total| eval TicketTypeTotal=(round((CountTicketType/Total)*100,2))",                      "preview": true     }">
                 </div>    
             <div id="bubbleChart1" class="splunk-view" data-require="app/search/components/bubblechart/bubblechart" data-options="{                      &quot;managerid&quot;: &quot;bubbleSearch1&quot;,                      &quot;nameField&quot;: &quot;Ticket Type&quot;,                      &quot;categoryField&quot;: &quot;Total&quot;,                      &quot;valueField&quot;: &quot;TicketTypeTotal&quot;,                      &quot;height&quot;: 450                   }">
                 </div>
             </html>
        </panel>
      </row>
    </form>
Tags (3)
0 Karma

niketn
Legend

@patricianaguit which version of Splunk are you using. Is there any reason why you are not using built in Bubble Chart visualization which is available in Splunk from version 6.4 onward?

On second note, I am not sure Bubble Chart is supposed to be used the way you are trying as there should be JavaScript code rendering the visualization. But I might be wrong.

Do check out Splunk Dashboard Examples App which should have the Example for Bubble Chart as well.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...