question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

display only script messages with mitmdump

See original GitHub issue

It would be nice if there is a built-in way to only display script messages with mitmdump. Currently it looks like there is no feature like this, the --flow-detail 0 option displays other messages as well so a workaround is to use grep to display the message we want to catch from a script, for example mitmdump --flow-detail 0 -s script.py | grep MESSAGE. The disadvantage is that it does filtering with unnecessary processing through a third-party tool like grep.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Prinzhorncommented, Aug 17, 2020

Can you combine --quiet with print() inside your script? mitmdump itself should then not print anything and all you get is the output of your script. Worked well for me so far.

1reaction
baptxcommented, Aug 28, 2020

@mhils Thanks. In a future version, would it be possible to have an option to use ctx.log.info() instead of print() to display only script messages with mitmdump? This would be useful in case we have a script that is already using ctx.log.info() but we don’t want to change the code to use print() or if we want to use the event log of mitmproxy also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Examples
Add a custom message body pretty-printer for use inside mitmproxy. This example shows how one can add a custom contentview to mitmproxy, which...
Read more >
Use mitmdump to Capture Refinitiv Real-Time - Optimized ...
In this article, we only focus on the mitmdump tool on Windows. ... After running, it will display the full request URL with...
Read more >
Creating scripts for mitmproxy - Bad Gateway
As the best way to learn is often to see an example, here is a simple one. This script will change the HTTP...
Read more >
Introduction to mitmdump | YoshiTech Blog - WordPress.com
Sample scripts are inside the folder. Taking the script to dump HTTP traffic in HAR file for example, we will see how the...
Read more >
mitmdump - a man-in-the-middle proxy with a command- ...
Optional Arguments: -h, --help Show this help message and exit. ... -s script.py --bar , --script script.py --bar Run a script. Surround with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found