I have several rows of data that looks the following:
255.255.255.255 - - [dd/mm/yyyy hh:mm:ss] "GET /index.html?parameter1=valueN HTTP/1.1" 200 -
255.255.255.255 - - [dd/mm/yyyy hh:mm:ss] "GET /index.html?parameter2=valueN HTTP/1.1" 200 -
However I want to only show this part of the line:
parameter=value
But it must be done by a command similar to this because I need the continual output that tails can deliver:
tails -f <file.log> | whatever
I can remove both the first part of the line and the last part, but I am unable to figure out how to achieve that in one line. I have the following script that will do as I want, but it only works with cat, and not with tails:
cat file.log | cut -d'?' -f2 | sed 's/ HTTP\/1\.1\" 200 \-/ /g' | grep -E "parameter1|parameter2"
Results in:
parameter1=valueN
parameter2=valueN
I have also tried several other commands with cut, tr and grep that brings me somewhat closer to what I want, however still doesn't match what I've shown above. What do I do?