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.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...