I'm using a service to manage my users who charges me per api call. Lately the api calls has increased greatly and I want to
log to file or to sttout all the outgoing http calls from the server (debian)
In my localhost I've done this with hacks using mitmproxy
obviously , I can't do it in my production server.
How can I log the https calls and then grep only the relevant ones ?
1 Answer
I assume you have root priviledges on your production server.
You can try using tcpdump, log the output to file and then parse/filter it as you see fit with tools like grep, sed etc...
Please note that tcpdump includes a failrly complex and complete set of filtering options, so be sure to check the man page.
This is a sample command to log all outgoing https requests (run as root):
tcpdump -s 0 'tcp dst port 443'