Dashboards & Visualizations

How to get "host" token to work with HTML Tag Cloud?

nyp_kwyc
Explorer
 <html>
      <h2>Events Trend</h2>
      <div id="tagcloud-search1" class="splunk-manager splunk-searchmanager" 
        data-require="splunkjs/mvc/searchmanager" 
        data-options="{            
                &quot;app&quot;: &quot;androidForensics&quot;,             
                &quot;preview&quot;: true,             
                &quot;search&quot;: &quot;index=androidforensics  host=$$host$$ | eval sourcetype=case(sourcetype=\&quot;gmailMessages\&quot;, \&quot;Gmail message\&quot;,        sourcetype=\&quot;calendar_events\&quot;, \&quot;Calendar_Event\&quot;, sourcetype=\&quot;calls\&quot;,             \&quot;Phone Call\&quot;, sourcetype=\&quot;wa_messages\&quot;, \&quot;WhatsApp Message\&quot;,        sourcetype=\&quot;chrome_history\&quot;, \&quot;Google Chrome History\&quot;,        sourcetype=\&quot;sms\&quot;, \&quot;SMS\&quot;, sourcetype=\&quot;gdrive_docs\&quot;,        \&quot;Google Drive document\&quot;) | stats count by sourcetype&quot;,            &quot;earliest_time&quot;: &quot;&quot;,         &quot;latest_time&quot;: &quot;&quot;      }">
    </div>


<div id="tagcloud" class="splunk-view" data-require="app/androidForensics/tagcloud" data-options="{           &quot;minFontSize&quot;: 12,           
        &quot;maxFontSize&quot;: 45,           
        &quot;managerid&quot;: &quot;tagcloud-search1&quot;,          
        &quot;valueField&quot;: &quot;count&quot;,           
        &quot;labelField&quot;: &quot;sourcetype&quot;     }">
</div>          
</html>

Above is a snippet of my tagcloud code, I am current trying to utilize the tagcloud to show my data
However I cant get the token "host" to work with it. I tried replacing the $ character with %24, but it is still not working.
The host is dynamic.

Tags (4)

MattZerfas
Communicator

I was able to get this working by follow the anwser here talking about putting double $$'s but in the token safe format.

http://answers.splunk.com/answers/109260/splunk6-custom-html-visualization-not-updating-if-form-inpu...

0 Karma

MattZerfas
Communicator

I am also trying to do something similar to this. I am wanting to add a time picker in and have the tag cloud panel use the timeframe from the picker. I am not having any luck. Anyone have any ideas or experience with adding time picker info in html panels?

0 Karma

ramdaspr
Contributor

$$host$$ should work fine..

 data-options='{     
    "app": "androidForensics",  "host"="$$host$$" 
 }'>

nyp_kwyc
Explorer

Thanks for the reply.

I updated my code
replacing $$host$$ dosent work for me
any other suggestion?

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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...