Dashboards & Visualizations

Dropdown menu with sourcetypes

cafissimo
Communicator

Hello, I would like to populate a dropdown in a form with all sourcetypes I have indexed. I remember something like "| metadata = sourcetype", but I am not sure. Any help would be appreciated. Thanks in advance

Tags (1)
0 Karma
1 Solution

ziegfried
Influencer

The search you're looking for is:

| metadata type=sourcetypes

And to get a dropdown, you can use a SearchSelectLister:

<module name="SearchSelectLister">
  <param name="settingToCreate">sourcetype</param>
  <param name="search">| metadata type=sourcetypes</param>
  <param name="label">sourcetype</param>
  <param name="searchWhenChanged">True</param>
  <param name="searchFieldsToDisplay">
    <list>
      <param name="label">sourcetype</param>
      <param name="value">sourcetype</param>
    </list>
  </param>
  ....

View solution in original post

ziegfried
Influencer

The search you're looking for is:

| metadata type=sourcetypes

And to get a dropdown, you can use a SearchSelectLister:

<module name="SearchSelectLister">
  <param name="settingToCreate">sourcetype</param>
  <param name="search">| metadata type=sourcetypes</param>
  <param name="label">sourcetype</param>
  <param name="searchWhenChanged">True</param>
  <param name="searchFieldsToDisplay">
    <list>
      <param name="label">sourcetype</param>
      <param name="value">sourcetype</param>
    </list>
  </param>
  ....
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...