Skip to main content

Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack

Workflow preview

Workflow preview
100%
Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Summary Efficiently monitor Kubernetes environments by sending only unique error logs from Grafana Loki to Slack. Reduces alert fatigue while keeping your team informed about critical log events....

Best for

  • DevOps automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by John Pranay Kumar Reddy.

Original n8n.io source

1.1 Workflow description

Title
Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack
Workflow name
Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack

โœจ Summary

Efficiently monitor Kubernetes environments by sending only unique error logs from Grafana Loki to Slack. Reduces alert fatigue while keeping your team informed about critical log events.

๐Ÿง‘โ€๐Ÿ’ป Whoโ€™s it for

  • DevOps or SRE engineers running EKS/GKE/AKS
  • Anyone using Grafana Loki and Promtail for centralized logging
  • Teams that want Slack alerts but hate alert spam

๐Ÿ” What it does

This n8n workflow queries your Loki logs every 5 minutes, filters only the critical ones (error, timeout, exception, etc.), removes duplicate alerts within the batch, and sends clean alerts to a Slack channel with full metadata (pod, namespace, node, container, log, timestamp).

๐Ÿง  How it works

๐Ÿ•’ Schedule Trigger

Every 5 minutes (customizable)

๐ŸŒ Loki HTTP Query

Pulls logs from the last 10 minutes Keyword match: error, failed, oom, etc.

๐Ÿงน Log Parsing

Extracts log fields (pod, container, etc.) Skips empty/malformed results

๐Ÿง  Deduplication

Removes repeated error messages (within query window)

๐Ÿ“ค Slack Notification

Sends nicely formatted message to Slack

โš™๏ธ Requirements

Tool Notes

Loki- Exposed internally or externally Slack App- With chat:write OAuth n8n- Cloud or self-hosted

๐Ÿ”ง How to Set It Up

Import the JSON file into n8n

Update:

  • Loki API URL (e.g., http://loki-gateway.monitoring.svc.cluster.local)
  • Slack Bearer Token (via credentials)
  • Target Slack channel (e.g., #k8s-alerts)
  • (Optional) Change keywords in the query regex
  • Activate the workflow
  • Ensure n8n pod/container is having access to your kubernetes cluster/pods/namespaces

๐Ÿ›  How to Customize

  • Want more or fewer keywords? Adjust the regex in the Query Loki for Error Logs node.
  • Need to increase deduplication logic? Enhance the Remove Duplicate Alerts node.
  • Want 5-log summaries every 5 min? Fork this and add a Batch + Slack group sender.

Grafana Loki logs to Slack Output

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - ๐Ÿ“ฅ Query Loki for Error Logs

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - ๐Ÿ•’ Every 5 Min Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 3 - ๐Ÿงน Extract Log Fields

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - ๐Ÿง  Remove Duplicate Alerts

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - ๐Ÿ“ค Send Alerts to Slack

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack
Complexity intermediate
Nodes 11
Categories DevOps
Author John Pranay Kumar Reddy
Published 05 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7021/7021.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send deduplicated Kubernetes(EKS/GKE/AKS) error logs from Grafana Loki to Slack do?

Summary Efficiently monitor Kubernetes environments by sending only unique error logs from Grafana Loki to Slack. Reduces alert fatigue while keeping your team informed about critical log events....

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.