get_metadata
Retrieve distinct metadata values like hosts, sourcetypes, or sources from a Splunk index to discover data availability and build targeted searches.
Instructions
Retrieve distinct metadata values for a given index to aid query construction. Use this tool when you need to discover which hosts, sourcetypes, or sources are present in an index within a recent time window. This is useful for building targeted searches or validating data availability. Results are constrained by your Splunk permissions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | Target index to inspect (e.g., 'main', 'security') | |
| field | No | Metadata field to list values for. One of 'host', 'sourcetype', or 'source' (default: 'host') | host |
| earliest_time | No | Search start time (e.g., '-24h@h') (default: '-24h@h') | -24h@h |
| latest_time | No | Search end time (e.g., 'now') (default: 'now') | now |
| limit | No | Maximum number of distinct values to return (default: 100) |