Analyze Emr Cluster Logs
analyze_emr_cluster_logsAnalyzes Amazon EMR cluster logs with Athena to identify known issues across Spark, YARN, Hadoop, and related components, returning evidence and troubleshooting links.
Instructions
Analyze EMR cluster logs using Amazon Athena.
This tool connects to an EMR cluster's logs in S3 and runs Athena queries to identify known issues based on a comprehensive knowledge base of curated EMR issues.
Prerequisites
EMR cluster with logging enabled to S3
AWS credentials with permissions for EMR, Athena, and S3
Athena query result location configured
Response Format
The response includes detailed findings with:
Issue summary and description
Component classification (Spark, YARN, Hadoop, etc.)
Occurrence count and sample log evidence
AWS Knowledge Center links when available for additional guidance
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cluster_id": "<cluster_id>"
},
"name": "analyze_emr_cluster_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | AWS region where the cluster is located. If not provided, uses AWS_DEFAULT_REGION environment variable or defaults to us-east-1. | |
| cluster_id | Yes | EMR cluster ID to analyze (e.g., j-12FTFQ3AGIYQ4). Must be a valid cluster with logging enabled to S3. The tool will connect to the cluster's S3 logs and perform Athena queries to identify known issues. | |
| time_window | No | Time window in seconds to analyze logs (default: 300 = 5 minutes). Range: 30-300 seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if analysis failed | |
| status | Yes | Status of the analysis | |
| results | No | Detailed analysis results with occurrence statistics | |
| source_id | Yes | Cluster ID or session ID | |
| source_type | Yes | Type of log source analyzed | |
| issues_found | Yes | Number of unique issues found | |
| execution_time_ms | No | Analysis execution time in milliseconds | |
| total_occurrences | No | Total number of issue occurrences across all logs |