$npx -y skills add grandcamel/Splunk-Assistant-Skills --skill splunk-tagKnowledge object tags and field/value associations for Splunk.
| 1 | # splunk-tag |
| 2 | |
| 3 | Knowledge object tags and field/value associations for Splunk. |
| 4 | |
| 5 | ## Purpose |
| 6 | |
| 7 | Add, remove, and manage tags associated with field values for easier searching. |
| 8 | |
| 9 | ## Risk Levels |
| 10 | |
| 11 | | Operation | Risk | Notes | |
| 12 | |-----------|------|-------| |
| 13 | | List tags | - | Read-only | |
| 14 | | Search by tag | - | Read-only | |
| 15 | | Add tag | ⚠️ | Easily reversible | |
| 16 | | Remove tag | ⚠️ | Easily reversible | |
| 17 | |
| 18 | ## Triggers |
| 19 | |
| 20 | - "tag", "label", "classify" |
| 21 | - "tag field", "add tag" |
| 22 | |
| 23 | ## CLI Commands |
| 24 | |
| 25 | | Command | Description | |
| 26 | |---------|-------------| |
| 27 | | `tag add` | Add tag to field value | |
| 28 | | `tag remove` | Remove tag from field value | |
| 29 | | `tag list` | List all tags | |
| 30 | | `tag search` | Search using tag= syntax | |
| 31 | |
| 32 | ## Options |
| 33 | |
| 34 | | Option | Commands | Description | |
| 35 | |--------|----------|-------------| |
| 36 | | `-a`, `--app` | list, add, remove | App context (defaults to "search") | |
| 37 | | `-o`, `--output` | list, search | Output format (text, json) | |
| 38 | | `-i`, `--index` | search | Filter by index | |
| 39 | | `-e`, `--earliest` | search | Earliest time (defaults to -24h) | |
| 40 | |
| 41 | ## Examples |
| 42 | |
| 43 | ```bash |
| 44 | # List all tags (with short flags) |
| 45 | splunk-as tag list |
| 46 | splunk-as tag list -a search -o json |
| 47 | |
| 48 | # Add tag to field value (format: field::value tag_name) |
| 49 | splunk-as tag add host::webserver01 production |
| 50 | splunk-as tag add host::webserver01 production -a my_app |
| 51 | |
| 52 | # Remove tag from field value |
| 53 | splunk-as tag remove host::webserver01 production |
| 54 | splunk-as tag remove host::webserver01 production -a my_app |
| 55 | |
| 56 | # Search by tag (with short flags) |
| 57 | splunk-as tag search production |
| 58 | splunk-as tag search production -e -1h -i main |
| 59 | splunk-as tag search production -e -1h -o json |
| 60 | ``` |
| 61 | |
| 62 | ## SPL Patterns |
| 63 | |
| 64 | ```spl |
| 65 | tag=web_traffic |
| 66 | tag::src_ip=internal |
| 67 | ``` |