Skip to content
Skills Library
Security · Analysis

query-performance

/query-performance

Diagnose and optimize slow or expensive SIEM queries and scheduled detections in Splunk, Sentinel/KQL and Elastic — time scoping, indexed filtering, avoiding leading wildcards, accelerated data models, summary indexes, schedule windows and cost. Use when searches time out, scheduled detections skip or lag, or SIEM compute/query cost is too high.

Repository
Claude-Blue ↗
Licence
MIT
Last repository change
01.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 01.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Diagnose and optimize slow or expensive SIEM queries and scheduled detections in Splunk, Sentinel/KQL and Elastic — time scoping, indexed filtering, avoiding leading wildcards, accelerated data models, summary indexes, schedule windows and cost. Use when searches time out, scheduled detections skip or lag, or SIEM compute/query cost is too high.

Original author description

Diagnose and optimize slow or expensive SIEM queries and scheduled detections in Splunk, Sentinel/KQL and Elastic — time scoping, indexed filtering, avoiding leading wildcards, accelerated data models, summary indexes, schedule windows and cost. Use when searches time out, scheduled detections skip or lag, or SIEM compute/query cost is too high.

How it works

  1. Universal principles
  2. Platform specifics
  3. Scheduled detection hygiene
  4. Before/after record
  5. Related skills
  6. References
Original SKILL.md headings · 40 lines, 260 words
SKILL.md preview
---
name: query-performance
description: Diagnose and optimize slow or expensive SIEM queries and scheduled detections in Splunk, Sentinel/KQL and Elastic — time scoping, indexed filtering, avoiding leading wildcards, accelerated data models, summary indexes, schedule windows and cost. Use when searches time out, scheduled detections skip or lag, or SIEM compute/query cost is too high.
license: MIT
metadata:
  category: siem-engineering
  version: "2.0.0"
  verification: documented
---

# SIEM Query Performance

## Universal principles

1. **Narrow time first**, then the most selective indexed filter (index/table, sourcetype, EventCode).
2. **Filter before transform**: `where`/`search` before `stats`/`join`/`extend`.
3. **Avoid leading wildcards** and unanchored regex on large text fields.
4. **Project/fields** early to reduce data moved.
5. **Aggregate instead of join** where possible.
6. **Pre-compute**: accelerated data models/tstats (Splunk), summary rules/materialized views (Sentinel summary rules), transforms/rollups (Elastic).

## Platform specifics

| Platform | Tools | Tips |
|---|---|---|
| Splunk | Job Inspector (`search.log`, command durations), `| tstats` | Use `TERM()`/`PREFIX()` for indexed tokens; avoid `transaction`; check scheduler skipped searches: `index=_internal sourcetype=scheduler status=skipped` |
| Sentinel / KQL | Query stats (CPU, data scanned), `materialize()` for reused subqueries | `has` over `contains`; `summarize` before `join`; put the smaller table on the left of `join`; time filter on `TimeGenerated` first; Basic/Auxiliary tables cost per query |
| Elastic | Search Profiler, slow log | Query `keyword` fields for exact match; avoid script queries; use `filter` context (cached) |

## Scheduled detection hygiene

- Lookback ≥ schedule interval + ingestion delay (e.g. run every 5 min over last 10 min) to avoid gaps; dedupe overlaps.
- Stagger schedules (not all at :00).
- Monitor skipped/delayed runs and duration trends.

## Before/after record

`Query | Runtime before | Data scanned | Change | Runtime after | Result parity check (same rows?)` — always confirm optimization didn't change results.

## Related skills

`splunk-spl-investigation`, `sentinel-kql-investigation`, `elastic-investigation`, `detection-lifecycle`

## References

- Splunk search optimization: https://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutoptimization
- KQL best practices: https://learn.microsoft.com/en-us/kusto/query/best-practices
- Elasticsearch tune for search speed: https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-search-speed.html

Versions

RepositoryScoreLicence
This page · kaandgnsh/Claude-Blue100MIT
comet-ml/opik100Apache-2.0

Database snapshot: 13.11.2026 · package version f826936969ac (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100siem-elastic-siem-kql-eql-detection
    Use this skill when write KQL and Event Query Language (EQL) rules to detect suspicious behavior in Elastic SIEM.
  • 100siem-detection
    Engineer and audit SIEM detection rules — log source coverage, Sigma / KQL / SPL / Elastic query authoring, MITRE ATT&CK mapping, false-positive tuning, and detection-as-code workflows. Use when the user mentions 'SIEM,' 'detection engineering,' 'detection rules,' 'Sigma,'…
  • 100siem-microsoft-sentinel-kql-analytics
    Use this skill when develop Kusto Query Language (KQL) detection analytics and hunting queries in Microsoft Sentinel.
  • 95siem-engineering
    Design SIEM architecture, onboard log sources, create correlation rules, manage use cases, and tune detection. Use when the user asks about SIEM, Splunk, Wazuh, Elastic Security, Microsoft Sentinel, log source, correlation rule, or SIEM use case.
  • 95siem-rules
    Guides development of SIEM detection rules using KQL (Microsoft Sentinel) and SPL (Splunk) query languages, mapped to MITRE ATT&CK v16 techniques. Auto-invoked when the user needs to write SIEM queries, tune alert thresholds, build correlation rules, or manage the detection rule…
  • 100hunting-threats
    Run hypothesis-driven threat hunts across endpoint, network, cloud, and identity telemetry using stack counting, outlier analysis, and ATT&CK-based hypotheses, with SIEM query patterns for Splunk, KQL, and Elastic. Use when proactively searching for undetected compromise,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.