N
N
nixischev2014-10-12 09:59:06
bash
nixischev, 2014-10-12 09:59:06

Bash and Nginx - how to find URLs without redirects?

Good day!
Actually, subject. Approximate algorithm: on the server in access.log, you need to find lines with HTTP headers not equal to 301 and 302 (that is, URLs without redirection) and display them on the screen.
Something like:
cat access.log | grep [!= 301 || !=302]
The fact is that I am familiar with bash at a basic level and, to be honest, I have little idea how to make this script.Thanks
in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2014-10-12
@nixischev

cat access.log | egrep -v "301|302"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question