Dashboards & Visualizations

Can you help me validate simple XML in a dashboard?

jorwin
Engager

I'm trying to validate a dashboard after some scripted changes to avoid corrupting the XML.

I've tried different tools using the simplexml.rnc/simplexml.rng files in $SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/schema but it all fails.

Any ideas what is wrong?

E.g.
<dashboard>
  <label>test_dash</label>
  <row>
    <panel>
      <event>
        <title>search</title>
        <search>
          <query>index=hid100001195 sshd</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="list.drilldown">none</option>
      </event>
    </panel>
  </row>
</dashboard>

$ xmlstarlet val -e -r  simplexml.rng ../dash.xml 
../dash.xml:17.1: Extra element panel in interleave
../dash.xml:17.1: Element row failed to validate content
../dash.xml:17.1: Extra element row in interleave
../dash.xml:17.1: Element dashboard failed to validate content
../dash.xml - invalid

$ xmllint ../dash.xml --noout --relaxng all.rng 
Relax-NG validity error : Extra element panel in interleave
../dash.xml:4: element panel: Relax-NG validity error : Element row failed to validate content
Relax-NG validity error : Extra element row in interleave
../dash.xml:3: element row: Relax-NG validity error : Element dashboard failed to validate content
../dash.xml fails to validate

kramini
Engager

@jorwin I am facing the same problem. It worked only after removing the panel tag. Did you happen to resolve this issue?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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