On Sat, May 1, 2021, 3:17 AM Cameron Simpson <cs@cskk.id.au> wrote:
Let's take a not-absurd hypothetical:
GET [http://example.com/picture] 200 image/jpeg POST [http://nowhere.org/data] 200 application/json PUT [https://example.org/page] 200 text/html
Though for this, they are ok. Or even just:
method, _url_, code, mimetype = line.split(None,3)
Notice that in my example, I agree extra square brackets that I want to get rid of as well, which your line doesn't do. Of course an extra line or two could. But often enough, I want to remove certain fixed substrings in lines that don't have a uniform delimiter like a space. There shouldn't be any whitespace in a log line URL - it should be
percent encoded.
Lots of things "should be" :-). Sadly, I deal with "actually existing data."