Created
April 15, 2023 15:55
-
-
Save jlongman/c6234a9041fa9e142685c215a274f4b6 to your computer and use it in GitHub Desktop.
One element path 404s in apache log with cloudwatch log insights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fields @timestamp, @message | |
| parse @message /^(?<local>\S+) (?<remoteA>\S+)(, (?<remoteB>\S+))? - - \[(?<date>[\w:\+\/ -]*?)\] "(?<method>[A-Za-z-]+) (?<path>[\/\w_-]+) (?<protocol>[\/\w0-9\.-]+)" (?<status>[0-9-]+) (?<bytes>[0-9-]*) "(?<url>\S*?)" "(?<web>.*)"$/ | |
| filter path like /^\/\S+\/?$/ and status like /404/ | |
| stats count(*) as hits by path | |
| sort hits desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ended up having a minor typo which had me crawling all over the regex changing things, so maybe needs cleaning.