Dashboards & Visualizations

Force HTML into results?

andrewkenth
Communicator

Is there a way to force HTML into the results sets? In my case I'd like to insert a line return a results in order to use a single value visualization.

 blah blah blah | eval message=Date + "><![CDATA[<br>]]> " + upper + " GB (of " + Total + " GB)" | table message
Tags (2)
0 Karma
1 Solution

andrewkenth
Communicator

I was able to simply put my message into 1 field using eval and them simply displaying said single field in a single value module:

index=charlesriver sourcetype=disk* sourcetype=diskWatcher_PRD Filesystem=*Raw* OR Filesystem=*apps* | bucket span=1d _time | eval Total=Used+Available | eval Used=(Used/1048576) | eval Total=(Total/1048576) | chart sum(Used) as Used sum(Total) as Total over _time | predict Used as Forecasted lower10=lower upper50=upper future_timespan=550  | eventstats max(upper) AS max latest(Total) as Total latest(Used) as Used | where upper=max | eval Date=strftime(_time,"%m/%d/%Y %A") | eval Current=tostring(round(upper)-round(Used)) |  eval upper=tostring(round(upper)) | eval Total=tostring(round(Total)) | eval message=Date + ": " + Current + " GB (of " + Total + " GB)" | table message

View solution in original post

0 Karma

andrewkenth
Communicator

I was able to simply put my message into 1 field using eval and them simply displaying said single field in a single value module:

index=charlesriver sourcetype=disk* sourcetype=diskWatcher_PRD Filesystem=*Raw* OR Filesystem=*apps* | bucket span=1d _time | eval Total=Used+Available | eval Used=(Used/1048576) | eval Total=(Total/1048576) | chart sum(Used) as Used sum(Total) as Total over _time | predict Used as Forecasted lower10=lower upper50=upper future_timespan=550  | eventstats max(upper) AS max latest(Total) as Total latest(Used) as Used | where upper=max | eval Date=strftime(_time,"%m/%d/%Y %A") | eval Current=tostring(round(upper)-round(Used)) |  eval upper=tostring(round(upper)) | eval Total=tostring(round(Total)) | eval message=Date + ": " + Current + " GB (of " + Total + " GB)" | table message
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Have you considered using the HTML module instead of SingleValue?

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...