I am trying to delete certain lines from my web server logs based on a certain criteria.
Here is a sample line from the logs:
2005-05-17 03:59:59 GET /applications/pwrdesk/temp
if - 443 - 22.214.171.124 HTTP/1.1 Mozilla/4.0+(compatible;+M
avc01.onceanddone.com 200 851 480 0
What I need to do is delete all lines that contain .gif or .jpg, unless they contain the status code of 40x (400, 401, 402, etc...) or 50x (500, 501, 502, etc...) the status code is the 4th from last token in the example. (in the example, the status code is 200).
The token that will contain the .gif or .jpg is the 14th. (dashes in the above example count as tokens.
Is there a way to do this?