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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...