Question: Given the following log message for reference, create a set of commands ( grep and awk, or awk only ) to create a brief report

Given the following log message for reference, create a set of commands (grep and awk, or awk only) to create a brief report containing the following fields:
Date (field 1), Client IP (field 6), Client Source Port (field 8),URI (field 15)
Filter criteria:
Filename: apache2/error.log, Regular expression term: "Invalid URI"
Log Message:
2021-10-13-19:02:14.903229[core:error] pid: 4001client: 167.99.133.28 Port:53004AH00126: Invalid URI in request GET /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/hosts
Resulting report for this message should be:
2021-10-13-19:02:14.903229,167.99.133.28,53004,/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/hosts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!