arupbiswas09/claude_skills/kql-query-builder
Claude Code and agent skill by arupbiswas09/claude_skills
- community
Checking that the SKILL.md file is still in the repository.
Write, explain, and optimise Kusto Query Language (KQL) queries for Azure Log Analytics, Application Insights, and Azure Monitor.
Install
npx vskill@latest install arupbiswas09/claude_skills/kql-query-builderSKILL.md
The same SKILL.md was published earlier as arupbiswas09/claude_skills/kql-query-builder.
KQL Query Builder
Write, explain, and optimise Kusto Query Language (KQL) queries for Azure Log Analytics, Application Insights, and Azure Monitor.
Trigger
Use this skill when the user asks to:
- Write or generate a KQL query
- Debug or fix a failing/slow KQL query
- Explain what a KQL query does
- Optimise query performance
- Find logs, traces, exceptions, metrics, or alerts in Azure
- Query specific tables:
AzureDiagnostics,AppRequests,AppExceptions,Heartbeat,ContainerLog,SecurityEvent,AuditLogs,SigninLogs,Perf,Usage, etc.
Instructions
Before writing a query
Ask (or infer from context) the following if not already provided:
- Target service — Log Analytics workspace, Application Insights, or Azure Monitor Metrics?
- Time range — default to
last 24h(ago(24h)) if unspecified - What to find — errors, latency, a specific operation, a resource, a user, a correlation ID?
- Output shape — raw rows, aggregated counts, a time-series chart, a top-N list?
Query construction rules
Always follow this order of operators for readability and performance:
Performance rules (apply to every query):
- Put the most selective
whereclause first - Prefer
hasovercontainsfor string matching (uses the index) - Prefer
==over=~when case sensitivity is acceptable - Avoid
*inproject— name columns explicitly - Use
materialize()when the same subquery is referenced more than once - For large tables, always filter on
TimeGeneratedbefore any other column - Prefer
summarize ... by bin(TimeGenerated, 5m)over looping client-side
Correctness rules:
- Wrap column names with spaces in
['Column Name'] - Use
isnotempty()not!= "" - Use
toint(),toreal(),todatetime()for explicit casts rather than implicit coercion - In Application Insights queries use
union isfuzzy=truewhen spanning multiple resources - Use
letstatements to define reusable sub-expressions and make intent clear
Output format
Return:
- The query in a fenced KQL code block
- A brief explanation (one sentence per operator) so the user can adapt it
- Any caveats (permissions needed, table retention limits, sampling effects in Application Insights, etc.)
When the user wants a parameterised query, use let variables at the top:
Common patterns
Error rate over time
Slowest operations (p95 latency)
Exception details with correlation
Kubernetes pod restarts (Container Insights)
Azure AD sign-in failures
Resource health events
Alert rule — threshold over 5-minute window
Explaining an existing query
When the user pastes a query and asks what it does:
- Identify the source table and the data domain
- Walk through each operator in order, one sentence each
- State what the final output shape is (columns, sort order, row limit)
- Flag any performance or correctness concerns
Debugging a query
When the user reports an error or unexpected results:
- Check operator order (filter → aggregate → project)
- Verify column name casing (KQL column names are case-sensitive)
- Check time range —
ago()is relative to query execution time - Check for implicit type mismatches (string vs. int comparisons)
- Suggest
take 10on intermediate steps to inspect intermediate rows - For "no results": relax filters one by one to find where data disappears
References
- KQL quick reference
- Common Log Analytics tables
- Query performance patterns
- Official docs: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kql-query-builder/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arupbiswas09/claude_skills/kql-query-builder)