I am trying to use Python to parse the Nginx error log file to determine if something happened in the last 15 minutes then do some things based off that.
I have nothing significant to show yet because I am totally unsure about how to do this. I have the rest of my script done in the sense it does everything I need except parsing the log file. I have looked google and on SO but have not found anything that would help me. I figured out how to check the last say 10 lines but that doesn't solve the time issue.
I'm hoping someone can give me some direction. Or an example of how to parse a log file including the time and error message *show below as error I need to find
I know there is no code and SO normally wants code though I have nothing to show for this part of the script and don't think there is a better stack exchange place to ask this question. Seems a bit basic for the software engineering one.
This is an example of the log file entry that I need to find a
2019/03/15 14:22:59 [error] 14064#0: <error I need to find>, client: XXX.XXX.XXX.XXX, server: example.com, request: "POST /hello", host: "example.com"