3

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 ?

2
  • I believe you’re going about this the wrong way. Surely you know what causes an API call to be made and also which program does it. That’s where you need to start looking.
    – Daniel B
    Commented Dec 4, 2016 at 12:41
  • hi Daniel, Their api client is causing the api calls, obviously. BUT, it's a wrapper around the actual api calls so I don't know exactly how many and how to catch them all in one place?
    – WebQube
    Commented Dec 4, 2016 at 12:48

1 Answer 1

3

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'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .