Answer the question
In order to leave comments, you need to log in
How to collect logs for a specific file for a period?
There is a server on Debian, it has access logs in nginx for every day
site.ru_access.log-20210618 in gz archive. Do I need to pull out the logs for a specific file when it was accessed?
Can this be done automatically somehow?
Answer the question
In order to leave comments, you need to log in
Use the following command:
grep 'needle' file.log >> result.txt
If you want to be able to conveniently filter by any parameter - write not to files, but to a storage with the possibility of indexing, at least the same ELK. If this is an overkill and the need arises relatively rarely, write a script with a grep of the desired one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question