|
For an example how someone could use this: I ran a jstest locally which does many queries. I can use grep "About to run" out to find which request I’m interested in, and then I want to find exactly the log lines that correspond to that request. Currently I can use the date + connection ID… something like:
grep conn9 out | sed -n '/20:42:18.*About to run/,/About to run/ p'
|
But it would be simpler if I could note the request ID (say 123) and run:
Another use case: I’m debugging a flaky test, so I run with --repeatTests 20. Once I find all the interesting "About to run" lines, I want the "Estimated cardinality" lines within those requests. If I could extract a request ID (say 123, 456, 789), then I could run:
jq 'select(.msg == "Estimated cardinality" and .r == (123, 456, 789))'
|
|