I am trying to write a small script which will have to read the nginx access log file and create a directory if it is not existing. This is my web server log: 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/9-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/7-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/2-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/3-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/8-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/4-149975426.ts HTTP/1.1 500 227 192.168.1.1 - - [11/Jul/2017:06:24:28 +0000] PUT /live/chan/5-149975426.ts HTTP/1.1 500 227 I want my script to check if /live/chan/ directory exists and if not to create it. I am using bash scripting for it. I am just missing the parsing logic. I guess as soon as I manage to get the path, I would be able to write the rest of the script checking if the directory is valid and to create in case it is not existing. 
Read nginx log file and create directory if it is not existing from a PUT request
linux;bash;http