Dashboards & Visualizations

Can I use a jQuery accordion with a Simple XML dashboard?

szabados
Communicator

I checked that sample app in the docs, but HTML dashboards are used in that guide. Can I use that accordion with a Simple XML dashboard?

0 Karma

chanmi2
Path Finder

you can do something like this:

inside the js, you can call some library first like the fourth section in the tutorial link

require.config({ the code in the third section });
require([
    'jquery', 'jquery-ui', 'splunkjs/mvc/simplexml/ready!'
], function($) {
}

Hope it is what you want and it works for you

0 Karma

szabados
Communicator

I'm sure because of the lack of my web dev knowledge, but I don't exactly get this.
I got a simple dashboard like this:

<dashboard>
  <label>test</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_internal | head 10 | chart count by host</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="wrap">undefined</option>
        <option name="rowNumbers">undefined</option>
        <option name="drilldown">row</option>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_internal | head 15 | chart count by _time</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="wrap">undefined</option>
        <option name="rowNumbers">undefined</option>
        <option name="drilldown">row</option>
      </table>
    </panel>
  </row>
</dashboard>

Where should I add the code you've mentioned ?

0 Karma

chanmi2
Path Finder

include the js or css file in dashboard tag

add html in panel

<panel>
  <html>
    <div id="sth"/>
  </html>
</panel>

then inside the js, you can use that piece of js code

installing this app might help you get familiar with dashboard with js: "Splunk 6.x Dashboard Examples"

0 Karma

gcato
Contributor

Hi szabados,

I'm not exactly sure what docs etc. you're referring to, but the Splunk 6.x Dashboard Examples app, from splunkbase (https://splunkbase.splunk.com/app/1603/), has an example of a jQuery accordion type dashboard that uses simple XML and javascript. The one I'm referring to in the app is found under Examples -> Table Elements -> Table were row expand to show more information. Hope this helps.

0 Karma

szabados
Communicator
0 Karma

gcato
Contributor

Okay, so it is the same thing. Have you had a look at the example's dashboard?

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...