Dashboards & Visualizations

How to populate dropdown values from csv file using javascript?

kevshah
Explorer

I've input lookup table csv file in splunk envrinoment where I want to pull dropdown values from. Since I am new to HTML dashboarding in splunk, I don't know how to search inputlook up table using javascript.

This is how I am doing in Advanced xml, any idea how to achieve this in HTML dashboard?

 <module name="Search" autoRun="True">
      <param name="search"><![CDATA[
| inputlookup xvz.csv | fillnull value=* | fields Index, sourcetype, env, jvm_name]]></param>


       <module name="Pulldown">
          <param name="postProcess">dedup sourcetype | sort sourcetype</param>
          <param name="cssClass">dropBox</param>
          <param name="size">6</param>
          <param name="valueField">sourcetype</param>
          <param name="staticOptions"/>
          <param name="name">sourcetype</param>
          <param name="template">sourcetype=$value$</param>
          <param name="label">Sourcetype</param>

</module>
</module>

asimagu
Builder

I suggest that you build this dashboard in Simple XML and then use the built-in feature of converting to HTML. You will have your dashboard working plus you will learn how it is done in HTML 😉

0 Karma

kevshah
Explorer

I tried that and it works but it creates a default splunk dropdown view, my requirement is to create more customized view. Any idea on how to create custom view?

0 Karma

asimagu
Builder

what about using the Javascript sdk for Splunk?

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