Skip to content

afranisagurcan/log_analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High Performance Log Analyzer

A high-performance log analyzer written in C that searches for a given keyword in a large log file using parallel processes and pipes. It ensures ordered output, handles large files efficiently, and is written in portable ANSI C (C99).


Build Requirements

  • GCC or compatible C compiler
  • POSIX-compliant system (Linux, macOS, WSL, etc.)
  • make utility

No external libraries required. Fully self-contained and portable.


Project Structure

log_analyzer/
├── src/                  # Source code (.c files)
├── include/              # Headers (.h files)
├── test/                 # Test input/output files
├── out/                  # Output binary goes here
├── build/                # Object files created here
├── Makefile              # Build script
└── README.md             # This file

Build and Run the Project

Make sure you have installed these tools on your Linux distro

sudo apt update && sudo apt install -y build-essential gcc make doxygen cmake

Change program arguments from the Makefile

# ------------------------------
# Program Arguments
# ------------------------------

INPUT_FILE    = $(TEST_DIR)/input.txt
OUTPUT_FILE   = $(TEST_DIR)/output.txt
KEYWORD       = "log_analyzer"
NUM_PROCESSES = 4
make run
make debug # Runs in debug mode(enables debug prints)

If you want to run program manually you can write below command after make run in root ("/") path of the log_analyzer;

./out/log_analyzer ./test/input.txt ./test/output.txt 4 log_analyzer

Documentation

  • You can generate doxyfiles via doxygen tool.
# Generate document via doxygen
doxygen Doxyfile
  • And you can access the project documentation in docs/html/index.html path

Author

Afra Nisa Gurcan