Splunk Search

Is it possible to refer to externally-hosted CSS, images, etc in view XML?

cmurtaugh
Engager

I'm trying to create a customized view by building my own XML, and I see that it's possible to refer to CSS and image files stored on the Splunk server itself. But, my splunk server is administrated by another group and I've only got web access.

I'd like to be able to refer to CSS files and images using a full URL to another server (where I can more easily edit them as I develop this custom view). Is this possible? I tried just putting

<view template="dashboard.html" stylesheet="<my url>">

into my XML, but I don't see a reference to that stylesheet in the rendered HTML. If I access my view with ?showsource=true on the end, I do see my CSS url in the properties section, though.

Thanks!

Tags (4)
0 Karma

sideview
SplunkTrust
SplunkTrust

You should be able to use the StaticContentSample, to render a <link> element to your externally hosted CSS.

<module name="StaticContentSample">
  <param name="text"><![CDATA[
     <link rel="stylesheet" type="text/css" href="http://somewhereelse.com/theme.css" />
  ]]></param>
</module>

Or if you're using Sideview Utils the HTML module can do the same thing and it adds a few more useful tricks with dynamic values.

hazekamp
Builder

Very cool!

0 Karma

hazekamp
Builder

The style sheet and images have to exist locally in the app you are using. However, Splunk does have an IFrameInclude module for using an inline frame to show content from another URL.

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 ...