Files
nexus/wiki/concepts/CloudWatch-Logs-Insights.md
weishen e62797a33a Batch 9: Obsidian插件/AI开源平替/Coze培训/TK面单/Ubuntu科学上网
- Sources: 5个新文档
- Concepts: ProxyChains, SOCKS5代理, Docker Daemon代理
- Index: 更新至 Batch 9
- 累计 sources: 108/182
2026-04-16 06:36:36 +08:00

33 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "CloudWatch Logs Insights"
type: concept
tags: [aws, observability, logging, analytics]
date: 2025-10-25
---
## Definition
CloudWatch Logs InsightsCloudWatch Logs 的结构化查询引擎,提供类 SQL 查询语言对日志进行实时分析、可视化和告警配置。
## Key Properties
- **查询语法**`fields` + `filter` + `parse` + `sort` + `limit` 管道化组合
- **跨账户查询**:可在管理账户跨所有成员账户查询集中日志
- **结构化解析**`parse` 命令支持正则表达式提取 JSON 嵌套字段(如 resource-type、status、logical-resource-id
- **可视化**:查询结果可直接绑定 CloudWatch Dashboard 图表
## Example QueryStackSets 场景)
```
fields @timestamp, account, region
| parse @message /"resource-type":"(?<resource_type>[^"]+)"/
| parse @message /"status":"(?<status>[^"]+)"/"
| sort @timestamp desc
```
提取:时间戳、账户 ID、区域、资源类型、部署状态。
## Related Concepts
- [[CloudWatch Logs]]Logs Insights 的数据来源
- [[可观测性]]Logs Insights 是可观测性体系的核心查询层
- [[CloudFormation StackSets]]:典型查询对象为 StackSets 部署事件
## Source
[[AWS-CloudFormation-StackSets-多账户集中日志监控]]