All Apps and Add-ons

How can i set valusetter module for dynamic pulldown ??

rakesh_498115
Motivator

Hi .

I have a dynamic pulldown which will have values generated dynamically . Now my requirement is in the dynamic pulldown.. when ever the dashboard is loaded i want the first value of the pulldown should be present by default . how can i do that ??

any hint pls ?? can i know whether it is possible or not in splunk pls ?? searching in google and splunkbase but didnt get any ans ?

sideview
SplunkTrust
SplunkTrust

If you update Sideview Utils to latest (2.6.1), I have actually fleshed out both the ValueSetter docs+examples as well as the Pulldown docs+examples, so that it's more clear how you're supposed to use ValueSetter to prepopulate a dynamic Pulldown.

I assume you have at least one static option in there as well, because if you didn't, then the first dynamic option would be the first overall option and it would be selected by default already. Although possibly you're asking about Pulldown in it's multiselect mode, whose default selection behavior is slightly different. At any rate there are a few details missing from your question! Post them if you can and I'll update my answer as necessary.

Here's a really simple example for you, where we prepopulate the "splunkd" option in the following Pulldown:

<module name="Search">
  <param name="search">index=_internal source="*metrics.log" group="per_sourcetype_thruput" | dedup series | sort series | fields series</param>
  <param name="earliest">-1h</param>
  <param name="latest">now</param>

  <module name="ValueSetter">
    <param name="name">sourcetype</param>
    <param name="value">splunkd</param>

    <module name="Pulldown">
      <param name="name">sourcetype</param>
      <param name="label">Sourcetype</param>
      <param name="valueField">series</param>
    </module>
  </module>
</module>

You just use ValueSetter to set a key upstream from the Pulldown, and you make the two name params match, and that's basically it. If you are using a multiselect Pulldown and you need to preselect more than one option you can do that too - the docs can show you how to use the delim param on ValueSetter to do that.

http://sideviewapps.com/apps/sideview-utils

0 Karma

linu1988
Champion

If you want to set a value by default and that's default you can use pulldown module's static fields to display parameter. If the result may come again from the search query you can put a NOT "value" in the search. Hope i understood your requirement.

0 Karma

sideview
SplunkTrust
SplunkTrust

You want the first value of the Pulldown should be present by default. I'm not entirely clear what you're asking here.

Do you always want the first option to be selected in the Pulldown no matter what that value is, or do you know what the value is, its always the same value, and it happens to be the first value in the list.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...