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

Chisels don't respect display filters #247

Open
gianlucaborello opened this issue Sep 18, 2014 · 3 comments
Open

Chisels don't respect display filters #247

gianlucaborello opened this issue Sep 18, 2014 · 3 comments

Comments

@gianlucaborello
Copy link
Contributor

sysdig -d -c echo_fds fd.port = 80

Will not respect the filter, and will show all the traffic anyway.

@Hefeweizen
Copy link
Contributor

Solving this problem effectively requires understanding the intent of display_filter and chisel encapsulation.

My understanding of the intent of chisels is to provide a mechanism that encapsulates useful functionality in a specific, but useful way. The lsof chisel gives us file utilization; the echo_fds pretty prints buffer contents; the spectrogram gives us latency visualization. These chisels are all of a class that provide their own direct output. I could imagine a second class of chisels that are effectively super filters. An example would be a chisel that filters out all processes that exist prior to the start of the capture; alternatively an advanced user could write a site/system-specific chisel for colleagues that help them remove extraneous information.

Expected usage would be:

$ sysdig -r original.scap -c filter_preexisting -c filter_db_admins -c lsof

Why do I touch on all this when the topic is display_filter? Chisels control screen output, disregarding anything the sysdig client might want to do. That's what causes this bug; chisels write directly to the screen and the sysdig client has no chance to apply the display_filter. I think cleaning up this behaviour allows us to specifically set expectations for what multiple chisels (and possibly, multiple filters) can do.

Currently, we have three behaviours:

  1. chisel -> screen
  2. regular filter -> chisel -> screen
  3. display filter -> screen

I can imagine more behaviours:
4. regular filter -> display filter -> screen
5. chisel -> display filter -> screen (where this issue started)
6. chisel -> chisel -> screen

A first change would be to implement display_filter as a flag that has it’s own filter argument; this allows behaviour 4.

To allow behaviour 5, you would either want to pass the display filter to the chisel (and ask all chisels to comply), or expose a buffer to the chisel where it can write its results (this buffer is then display_filtered by the sysdig binary). This latter solution allows behaviour 6 (it takes the write-back buffer and passes it as input to chisel2). However, this is tricky, because how do we accomodate chisels like spectrogram that need to write directly to the screen?

Thanks for listening to all this. I want to help implement something, I just want to know the most flexible path forward before making that first step.

@Hefeweizen
Copy link
Contributor

does this make sense as a behaviour:
7. regular filter -> regular filter -> screen

i.e specifying multiple filters on a command line?

@github-actions
Copy link

github-actions bot commented Mar 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

3 participants