I’m trying to find the parameters sent in all POST requests by looking at my production Rails log files. Right now I’m just using the following:
grep 'Started POST.*\/[fr]' log/production.log
This shows me when the POSTs happen but not the parameters. What I’d like is to do something along the lines of:
- Store the line in sed’s hold buffer when it encounters the regex above
- Print the contents of the hold buffer and the current line when it encounters “Parameters:”
As I understood you need to display line with regex and the following line.
grepcan do it itself:with
sedit will look like:or if not all following lines may content “Parameters” and you need only them: