azure-kusto by microsoft/azure-skills
npx skills add https://github.com/microsoft/azure-skills --skill azure-kusto执行 KQL 查询并管理 Azure Data Explorer 资源,用于对日志、遥测和时间序列数据进行快速、可扩展的大数据分析。
当用户提出以下请求时,请立即使用此技能:
关键指示器:
此技能支持查询和管理 Azure Data Explorer (Kusto),这是一个专为日志和遥测数据优化的快速、高度可扩展的数据探索服务。Azure Data Explorer 使用 Kusto 查询语言 (KQL) 在数十亿条记录上提供亚秒级的查询性能。
核心功能:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
通过简单筛选从表中获取最近的记录。
示例 KQL :
Events
| where Timestamp > ago(1h)
| take 100
适用于 : 快速数据检查、近期事件检索
按维度汇总数据以获取洞察和报告。
示例 KQL :
Events
| summarize count() by EventType, bin(Timestamp, 1h)
| order by count_ desc
适用于 : 事件计数、分布分析、前 N 名查询
分析时间窗口内的数据以发现趋势和模式。
示例 KQL :
Telemetry
| where Timestamp > ago(24h)
| summarize avg(ResponseTime), percentiles(ResponseTime, 50, 95, 99) by bin(Timestamp, 5m)
| render timechart
适用于 : 性能监控、趋势分析、异常检测
组合多个表进行跨数据集分析。
示例 KQL :
Events
| where EventType == "Error"
| join kind=inner (
Logs
| where Severity == "Critical"
) on CorrelationId
| project Timestamp, EventType, LogMessage, Severity
适用于 : 根本原因分析、关联事件追踪
在查询前探索表结构。
工具 : kusto_table_schema_get
适用于 : 理解数据模型、查询规划
执行查询时,常见的字段模式:
ago()、between()、bin() 进行时间筛选查询结果包括:
🟢 性能优化:
wheretake 或 limit 减少数据传输🔵 查询模式:
summarize 进行聚合,而不是单独使用 count()bin() 进行时间分桶project 仅选择需要的列extend 添加计算字段🟡 常用函数:
ago(timespan): 相对时间 (ago(1h), ago(7d))between(start .. end): 范围筛选startswith(), contains(), matches regex: 字符串筛选parse, extract: 从字符串中提取值percentiles(), avg(), sum(), max(), min(): 聚合take 或 limit 以避免大型结果集summarize 进行聚合,而不是在客户端处理| 工具 | 用途 |
|---|---|
kusto_cluster_list | 列出订阅中的所有 Azure Data Explorer 集群 |
kusto_database_list | 列出特定 Kusto 集群中的所有数据库 |
kusto_query | 对 Kusto 数据库执行 KQL 查询 |
kusto_table_schema_get | 检索特定表的架构信息 |
必需参数 :
subscription: Azure 订阅 ID 或显示名称cluster: Kusto 集群名称 (例如 "mycluster")database: 数据库名称query: KQL 查询字符串 (用于查询操作)table: 表名称 (用于架构操作)可选参数 :
resource-group: 资源组名称 (用于列表操作)tenant: Azure AD 租户 ID如果 Azure MCP Kusto 工具失败、超时或不可用,请使用 Azure CLI 命令作为回退。
| 操作 | Azure CLI 命令 |
|---|---|
| 列出集群 | az kusto cluster list --resource-group <rg-name> |
| 列出数据库 | az kusto database list --cluster-name <cluster> --resource-group <rg-name> |
| 显示集群 | az kusto cluster show --name <cluster> --resource-group <rg-name> |
| 显示数据库 | az kusto database show --cluster-name <cluster> --database-name <db> --resource-group <rg-name> |
对于查询,使用 Kusto REST API 或直接集群 URL:
az rest --method post \
--url "https://<cluster>.<region>.kusto.windows.net/v1/rest/query" \
--body "{ \"db\": \"<database>\", \"csl\": \"<kql-query>\" }"
在以下情况切换到 Azure CLI:
每周安装次数
12.9K
代码仓库
GitHub 星标
2
首次出现
5 天前
安全审计
安装于
github-copilot12.9K
opencode10
codex10
gemini-cli10
kimi-cli9
amp9
Execute KQL queries and manage Azure Data Explorer resources for fast, scalable big data analytics on log, telemetry, and time series data.
Use this skill immediately when the user asks to:
Key Indicators:
This skill enables querying and managing Azure Data Explorer (Kusto), a fast and highly scalable data exploration service optimized for log and telemetry data. Azure Data Explorer provides sub-second query performance on billions of records using the Kusto Query Language (KQL).
Key capabilities:
Fetch recent records from a table with simple filtering.
Example KQL :
Events
| where Timestamp > ago(1h)
| take 100
Use for : Quick data inspection, recent event retrieval
Summarize data by dimensions for insights and reporting.
Example KQL :
Events
| summarize count() by EventType, bin(Timestamp, 1h)
| order by count_ desc
Use for : Event counting, distribution analysis, top-N queries
Analyze data over time windows for trends and patterns.
Example KQL :
Telemetry
| where Timestamp > ago(24h)
| summarize avg(ResponseTime), percentiles(ResponseTime, 50, 95, 99) by bin(Timestamp, 5m)
| render timechart
Use for : Performance monitoring, trend analysis, anomaly detection
Combine multiple tables for cross-dataset analysis.
Example KQL :
Events
| where EventType == "Error"
| join kind=inner (
Logs
| where Severity == "Critical"
) on CorrelationId
| project Timestamp, EventType, LogMessage, Severity
Use for : Root cause analysis, correlated event tracking
Explore table structure before querying.
Tools : kusto_table_schema_get
Use for : Understanding data model, query planning
When executing queries, common field patterns:
ago(), between(), bin() for time filteringQuery results include:
🟢 Performance Optimized:
where before joins and aggregationstake or limit to reduce data transfer🔵 Query Patterns:
summarize for aggregations instead of count() alonebin() for time bucketing in time seriesproject to select only needed columnsextend to add calculated fields🟡 Common Functions:
ago(timespan): Relative time (ago(1h), ago(7d))between(start .. end): Range filteringstartswith(), contains(), matches regex: String filteringparse, extract: Extract values from stringspercentiles(), avg(), sum(), max(), : Aggregationstake or limit for exploratory queries to avoid large result setssummarize for aggregations instead of client-side processing| Tool | Purpose |
|---|---|
kusto_cluster_list | List all Azure Data Explorer clusters in a subscription |
kusto_database_list | List all databases in a specific Kusto cluster |
kusto_query | Execute KQL queries against a Kusto database |
kusto_table_schema_get | Retrieve schema information for a specific table |
Required Parameters :
subscription: Azure subscription ID or display namecluster: Kusto cluster name (e.g., "mycluster")database: Database namequery: KQL query string (for query operations)table: Table name (for schema operations)Optional Parameters :
resource-group: Resource group name (for listing operations)tenant: Azure AD tenant IDIf Azure MCP Kusto tools fail, timeout, or are unavailable, use Azure CLI commands as fallback.
| Operation | Azure CLI Command |
|---|---|
| List clusters | az kusto cluster list --resource-group <rg-name> |
| List databases | az kusto database list --cluster-name <cluster> --resource-group <rg-name> |
| Show cluster | az kusto cluster show --name <cluster> --resource-group <rg-name> |
| Show database | az kusto database show --cluster-name <cluster> --database-name <db> --resource-group <rg-name> |
For queries, use the Kusto REST API or direct cluster URL:
az rest --method post \
--url "https://<cluster>.<region>.kusto.windows.net/v1/rest/query" \
--body "{ \"db\": \"<database>\", \"csl\": \"<kql-query>\" }"
Switch to Azure CLI when:
Weekly Installs
12.9K
Repository
GitHub Stars
2
First Seen
5 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot12.9K
opencode10
codex10
gemini-cli10
kimi-cli9
amp9
34,500 周安装
min()