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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...