I am looking at an access log from tomcat which has entires such as:
96.28.193.125 - - [10/May/2012:07:08:39 +0000] 0 "GET / " 200 123 "-" "-"
I want to use sed to just pull out the datetimes.
So I just see:
[10/May/2012:07:08:39 +0000]
I understand it should be something like this:
sed -e 's/oldstuff//g' inputFileName > outputFileName
Where oldstuff should be a regular expression to get text that is not between square brackets.
I haven’t a clue how to express that in a regular expression and would appreciate any tips?
My best effort is:
sed -e 's
/[^\[(.*?)\]]//g' inputfilename > outputFileName
Try this: