Get Metadata
get_metadataRetrieve distinct hosts, sourcetypes, or sources from a specific Splunk index to build accurate queries. Use pagination with offset when more results are available.
Instructions
Retrieve distinct metadata values for a given index to aid query construction. Use this when you need hosts, sourcetypes, or sources in an index. If has_more is true, call again with offset=next_offset.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"index": "<index>"
},
"name": "get_metadata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | No | 'host', 'sourcetype', or 'source' (default 'host') | host |
| index | Yes | Target index (e.g. 'main') | |
| limit | No | Page size. Default 100. Maximum 100. Values above 100 are capped; 0 uses 50. Do not send a larger limit. | |
| offset | No | Result offset (default 0) | |
| latest_time | No | End time (default 'now') | now |
| earliest_time | No | Start time (default '-24h@h') | -24h@h |