I am very new in this. I am trying to extract some text from my access log in a new file.
My log file is like this:
111.111.111.111 - - [02/Jul/2021:18:35:19 +0000] "GET /api/items HTTP/2.0" 304 0 "https://example.com/some/text/call-log?roomNo=5003" "Mozilla etc etc etc etc"
111.111.111.111 - - [02/Jul/2021:20:35:19 +0000] "GET /api/items HTTP/2.0" 304 0 "https://example.com/some/text/resevation-log?roomNo=4003" "Mozilla etc etc etc etc"
I want to extract in below format in a new file.
02/Jul/2021:18:35:19 +0000, call-log, 5003
02/Jul/2021:20:35:19 +0000, resevation-log, 4003
Till now I have managed to do this basic awk command:
awk '{print $4,$5,",",$11}' < /file.log
Which gives me the below output:
[02/Jul/2021:18:35:19 +0000] , "https://example.com/some/text/call-log?roomNo=5003"