There is a standard Apache log. The log is viewed remotely via ssh. It is necessary from the entire mass of the text to get the links for which errors 403 and 404 occur. How to do this?
1 answer
If the Apache log is a log file, then a grep on the line '403' and then cutting the required columns will get the required links:
grep ' 403 ' log | cut -d ' ' -f 7 If you need to avoid repetitions (duplicate links can be repeatedly encountered in the log), then the output can be further filtered:
grep ' 403 ' log | cut -d ' ' -f 7 | sort | uniq -c |