Skip to content

tyr1k/lognginx_today

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Script to extract response codes from Nginx access log

This is a simple bash script that extracts response codes from an Nginx access log for a given day.

Usage

Before running the script, make sure to set the log_file variable to the path of your Nginx access log file.

To run the script:

./extract_response_codes.sh

Description

The script performs the following steps:

  1. Checks if the specified log file exists.
  2. Extracts the access log entries for the current date into a new file named with the current date.
  3. Extracts the response codes from the new access log file and sorts them by frequency.
  4. Displays the sorted response codes.
  5. Deletes the new access log file.

Dependencies

  • Nginx
  • Bash

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages