splunk-job
# splunk-job
What this skill does
# splunk-job
Search job lifecycle orchestration for Splunk.
## Purpose
Manage the complete lifecycle of Splunk search jobs including creation, monitoring, control actions (pause/cancel/finalize), and cleanup.
## Risk Levels
| Operation | Risk | Notes |
|-----------|------|-------|
| Get job status | - | Read-only |
| List jobs | - | Read-only |
| Create job | - | Easily reversible via cancel |
| Pause/unpause job | ⚠️ | Can be undone |
| Finalize job | ⚠️ | Returns partial results |
| Cancel job | ⚠️ | Stops execution |
| Delete job | ⚠️⚠️ | Removes job and results |
## Triggers
- "job", "search job", "SID"
- "status", "progress", "state"
- "cancel", "pause", "unpause", "finalize"
- "list jobs", "delete job"
## Job States (dispatchState)
```
QUEUED → PARSING → RUNNING → FINALIZING → DONE
→ FAILED
→ PAUSED (on pause action)
```
| State | Description |
|-------|-------------|
| QUEUED | Job waiting in queue |
| PARSING | SPL being parsed |
| RUNNING | Search executing |
| FINALIZING | Results being finalized |
| DONE | Completed successfully |
| FAILED | Error occurred |
| PAUSED | Paused by user |
## CLI Commands
| Command | Description |
|---------|-------------|
| `job create` | Create search job, return SID |
| `job status` | Get dispatchState, progress, stats |
| `job poll` | Wait for job completion with timeout |
| `job cancel` | Issue /control/cancel action |
| `job pause` | Issue /control/pause action |
| `job unpause` | Issue /control/unpause action |
| `job finalize` | Issue /control/finalize action |
| `job ttl` | Set job time-to-live |
| `job touch` | Touch a job to extend its TTL |
| `job list` | List all search jobs for user |
| `job delete` | Remove job from dispatch directory |
## Examples
### Create and Monitor Job
```bash
# Create job
splunk-as job create "index=main | stats count by sourcetype" --earliest -1h
# Output: Job created: 1703779200.12345
# Check status
splunk-as job status 1703779200.12345
# Output: State: RUNNING, Progress: 45%, Events: 12345
# Wait for completion
splunk-as job poll 1703779200.12345 --timeout 300
# Output: Job completed: DONE, Results: 42
```
### Job Control
```bash
# Pause running job
splunk-as job pause 1703779200.12345
# Resume paused job
splunk-as job unpause 1703779200.12345
# Cancel job
splunk-as job cancel 1703779200.12345
# Finalize (stop and return current results)
splunk-as job finalize 1703779200.12345
```
### Job Management
```bash
# List all jobs
splunk-as job list
# Output: Table of active jobs with status
# Extend TTL (positional arg: SID TTL_VALUE)
splunk-as job ttl 1703779200.12345 3600
# Delete job
splunk-as job delete 1703779200.12345
```
## API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/services/search/v2/jobs` | POST | Create job |
| `/services/search/v2/jobs/{sid}` | GET | Get job status |
| `/services/search/v2/jobs/{sid}/control` | POST | Control actions |
| `/services/search/jobs` | GET | List jobs |
| `/services/search/jobs/{sid}` | DELETE | Delete job |
## Control Actions
```python
# Available actions for /control endpoint
actions = ['cancel', 'pause', 'unpause', 'finalize', 'touch', 'setttl', 'enablepreview', 'disablepreview']
# POST /services/search/v2/jobs/{sid}/control
# data={'action': 'cancel'}
```
## Job Properties
| Property | Description |
|----------|-------------|
| `sid` | Search job ID |
| `dispatchState` | Current state |
| `doneProgress` | Completion 0.0-1.0 |
| `eventCount` | Events scanned |
| `resultCount` | Results produced |
| `scanCount` | Buckets scanned |
| `runDuration` | Execution time |
| `ttl` | Time to live |
| `isFailed` | Failure flag |
| `isPaused` | Pause flag |
## Best Practices
1. **Always set time bounds** in the search query
2. **Use appropriate timeout** for poll_job.py
3. **Cancel jobs** when results are no longer needed
4. **Monitor progress** for long-running searches
5. **Extend TTL** for jobs you need to keep
## Related Skills
- [splunk-search](../splunk-search/SKILL.md) - Query execution
- [splunk-export](../splunk-export/SKILL.md) - Result extraction
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.