Detection Query Optimizer

Optimize Splunk SPL, Microsoft Sentinel KQL, and Elastic Security EQL/ES|QL detection queries.

471|74|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/MHaggis/Security-Detections-MCP --skill detection-query-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Detection Query Optimizer
Source: https://github.com/MHaggis/Security-Detections-MCP/tree/main/.claude/skills/spl-optimizer
Command: npx skills add https://github.com/MHaggis/Security-Detections-MCP --skill detection-query-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps security analysts and engineers write more efficient detection queries for Splunk (SPL), Microsoft Sentinel (KQL), and Elastic Security (EQL/ES|QL), reducing query execution time and resource consumption.

Core Features & Use Cases

  • Platform-Specific Guidance: Provides detailed optimization techniques tailored to SPL, KQL, and EQL/ES|QL.
  • Search Pipeline Internals: Explains how each SIEM processes queries to identify bottlenecks.
  • Anti-Pattern Identification: Highlights common mistakes that lead to slow queries.
  • Use Case: A security engineer is experiencing slow performance with a new Splunk detection rule. They use this Skill to understand why and refactor the SPL query to run significantly faster, allowing for more frequent execution.

Quick Start

Optimize a Splunk SPL query for performance by following the provided guidance.

Frequently Asked Questions about Detection Query Optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Splunk SPL queries to run faster?

To optimize Splunk SPL queries, you must understand search pipeline internals to identify bottlenecks and refactor common anti-patterns. This Skill provides specific techniques to reduce query execution time and resource consumption for detection rules.

Why is my Microsoft Sentinel KQL detection rule executing so slowly?

Your Microsoft Sentinel KQL detection rule may be executing slowly due to common query anti-patterns and inefficient search pipeline usage. This Skill helps identify these bottlenecks and provides platform-specific guidance to refactor KQL for better performance.

What is the best way to improve Elastic Security EQL query performance?

The best way to improve Elastic Security EQL query performance is by applying targeted optimization techniques that address search pipeline internals. This Skill highlights common mistakes and provides specific refactoring guidance for EQL and ES|QL detections.

Can I use this to identify anti-patterns in SIEM detection engineering?

Yes, you can use this to identify anti-patterns in SIEM detection engineering. It highlights common mistakes that lead to slow queries across Splunk, Microsoft Sentinel, and Elastic Security, helping you refactor rules for maximum performance.

Does this optimizer support both EQL and ES|QL for Elastic Security?

Yes, this optimizer fully supports both EQL and ES|QL for Elastic Security. It provides detailed platform-specific guidance covering search pipeline internals and optimization techniques tailored to both query languages.

When should I refactor a detection query for resource efficiency?

You should refactor a detection query for resource efficiency when execution times are too high or when you need to run detections more frequently. This Skill helps reduce resource consumption by explaining how each SIEM processes queries and identifying bottlenecks.