AgentSkillsCN

Splunk Tag

Splunk 标签

SKILL.md

splunk-tag

Knowledge object tags and field/value associations for Splunk.

Purpose

Add, remove, and manage tags associated with field values for easier searching.

Risk Levels

OperationRiskNotes
List tags-Read-only
Search by tag-Read-only
Add tag⚠️Easily reversible
Remove tag⚠️Easily reversible

Triggers

  • "tag", "label", "classify"
  • "tag field", "add tag"

CLI Commands

CommandDescription
tag addAdd tag to field value
tag removeRemove tag from field value
tag listList all tags
tag searchSearch using tag= syntax

Options

OptionCommandsDescription
-a, --applist, add, removeApp context (defaults to "search")
-o, --outputlist, searchOutput format (text, json)
-i, --indexsearchFilter by index
-e, --earliestsearchEarliest time (defaults to -24h)

Examples

bash
# List all tags (with short flags)
splunk-as tag list
splunk-as tag list -a search -o json

# Add tag to field value (format: field::value tag_name)
splunk-as tag add host::webserver01 production
splunk-as tag add host::webserver01 production -a my_app

# Remove tag from field value
splunk-as tag remove host::webserver01 production
splunk-as tag remove host::webserver01 production -a my_app

# Search by tag (with short flags)
splunk-as tag search production
splunk-as tag search production -e -1h -i main
splunk-as tag search production -e -1h -o json

SPL Patterns

spl
tag=web_traffic
tag::src_ip=internal