All projects

Nginx Log Processing Data Engineering Pipeline

Click an image to zoom.

Overview

This project demonstrates an end-to-end Data Engineering Pipeline for processing approximately 3.3 GB of Nginx access logs using Hadoop HDFS and Apache Spark. The pipeline ingests raw log data into HDFS, parses and validates the records, separates invalid records into a dedicated rejection layer, transforms valid data into a structured schema, and stores the processed data as Parquet files partitioned by year and month. An analytics layer is then built on top of the processed data to generate request volume, HTTP status, endpoint, and data quality metrics. Finally, the analytics outputs are connected directly to an interactive Power BI dashboard through WebHDFS. The project also focuses on running a large-scale batch workload in a resource-constrained local environment using Docker, including Spark resource tuning and HDFS integration.

Key Features

  • End-to-End Pipeline: Built a complete pipeline from raw Nginx logs to processed data, analytics, and Power BI reporting.
  • Large-Scale Log Processing: Processed approximately 3.3 GB of Nginx access logs using Apache Spark.
  • HDFS Data Lake: Used Hadoop HDFS to store raw logs, processed data, rejected records, and analytics outputs.
  • Log Parsing & Transformation: Parsed raw Nginx access logs into a structured schema containing IP, timestamp, HTTP method, URL, protocol, status code, response size, referrer, user agent, year, and month.
  • Data Quality Validation: Validated timestamps, IP addresses, HTTP requests, status codes, and response sizes before loading records into the processed layer.
  • Rejected Records Layer: Stored invalid records separately in Parquet format along with rejection reasons instead of silently dropping bad data.
  • Parquet Storage: Stored processed and analytics data using Snappy-compressed Parquet for efficient analytical processing.
  • Partitioning Strategy: Partitioned processed log data by year and month to organize the dataset for analytical workloads.
  • Analytics Layer: Generated request volume by hour, HTTP status class counts, status code counts, top endpoints, and top rejected-data reasons.
  • Power BI Integration: Connected Power BI directly to HDFS analytics outputs through WebHDFS for interactive visualization.
  • Resource Optimization: Tuned Spark execution for a resource-constrained local environment using controlled parallelism, shuffle partitions, and driver memory.
  • Dockerized Environment: Used Docker to run the Hadoop and Spark components locally and create a reproducible development environment.
  • Technical Troubleshooting: Resolved Spark RPC and heartbeat issues caused by excessive local parallelism and resource constraints, as well as a WebHDFS DataNode hostname resolution issue when integrating with Power BI.