Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter streams per SOURCE_ADDR #52

Open
nyxnor opened this issue Jul 20, 2022 · 2 comments
Open

filter streams per SOURCE_ADDR #52

nyxnor opened this issue Jul 20, 2022 · 2 comments

Comments

@nyxnor
Copy link

nyxnor commented Jul 20, 2022

Feature request

I'd like a command line option to filter streams per source_addr.

This is very useful when tor is running in a gateway and you have plenty of clients connecting to it. It makes output clearer by only showing the streams from the client you want to see.

By default, show streams from all source addresses, but if one or more are specified, then only the specified ones.

I cannot grep per source address and I don't understand why...
I'm trying $ carml monitor -cga | grep "from remote \"xxx.xxx.xxx.xxx:" I'm escaping the first quote and then ending at :because the port may vary. But even if I just try to grep the patternsfrom process, or from remote`, it is not working... It doesn't print anything.

$ carml monitor -cga | grep "from process"
^CException ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

If the sigpipe issue is fixed, then maybe there is no reason for a command line option, just a nice to have.

txtorcon already knows if it is local or remote, and I like if gets the process via /proc and prints it instead of solely 127.0.0.1. So would be great to have the addition of filtering per source address.

Monitor streams:
r being source address.

$ carml -cg --source-addr 10.172.20.1,10.172.20.2
$ carml -cg -r 10.172.20.1,10.172.20.2
@meejah
Copy link
Owner

meejah commented Jul 27, 2022

Sounds like a reasonable feature request.

I'd probably use multiple options instead of the comma (e.g. carml -cg --source-addr 10.172.20.1 --source-addr 10.172.20.2 for the first example)

@nyxnor
Copy link
Author

nyxnor commented Aug 3, 2022

sounds good for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants