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).
- GCC or compatible C compiler
- POSIX-compliant system (Linux, macOS, WSL, etc.)
makeutility
No external libraries required. Fully self-contained and portable.
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
Make sure you have installed these tools on your Linux distro
sudo apt update && sudo apt install -y build-essential gcc make doxygen cmakeChange program arguments from the Makefile
# ------------------------------
# Program Arguments
# ------------------------------
INPUT_FILE = $(TEST_DIR)/input.txt
OUTPUT_FILE = $(TEST_DIR)/output.txt
KEYWORD = "log_analyzer"
NUM_PROCESSES = 4make run
make debug # Runs in debug mode(enables debug prints)If you want to run program manually you can write below command after
make runin root ("/") path of the log_analyzer;
./out/log_analyzer ./test/input.txt ./test/output.txt 4 log_analyzer- You can generate doxyfiles via doxygen tool.
# Generate document via doxygen
doxygen Doxyfile- And you can access the project documentation in
docs/html/index.htmlpath
Afra Nisa Gurcan