Dashboards & Visualizations

xi:include parts of the code for better overview

lemikg
Communicator

Hello,

I am trying to get a better overview of the view's code (about 4k lines of code). Therefore I was trying to outsource parts of the code and call them via xi:include command, but get an error

XML Syntax Error: Namespace prefix xi on include is not defined, line 82, column 18

in return.

Has anyone experience in using that command?

Kind regards
Mike

Tags (2)
0 Karma

sideview
SplunkTrust
SplunkTrust

I'm afraid that neither Splunk's Simple xml format nor the underlying advanced XML format support XInclude, nor any other way for you to include parts of the XML from outside the file itself.

to give some hope, I am working on a way to essentially get this feature as a part of a future version of Sideview Utils but it's not ready yet and most likely won't appear until 3.0.

However, if you have 4K lines of XML, and you're not already using Sideview Utils, you should check it out - Assuming this is an Advanced XML view and you're using only core Splunk modules still, switching to the modules in Sideview Utils can cut that number of lines roughly in half, and remove a lot of the indentation complexity. Here's a 10min video on youtube that's more or less on this topic:

0 Karma

lemikg
Communicator

hi, i think i would back that request. An example would look like something like this

http://cs.au.dk/~amoeller/XML/common/xinclude.html



0 Karma

jonuwz
Influencer

post an example. I know @Drainy once asked about the ability to include common XML fragments in views. The response was that it was a good candidate for an enhancement request.

I dont know it this is what you're asking about though.

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