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

How to get only user typing commands #266

Open
5 tasks done
youjeongsue opened this issue Dec 8, 2023 · 3 comments
Open
5 tasks done

How to get only user typing commands #266

youjeongsue opened this issue Dec 8, 2023 · 3 comments

Comments

@youjeongsue
Copy link

Checklist before starting to submit this support request

I confirm that:

  • I am requesting support! :)
  • I have tested this with the latest stable Snoopy version (or the latest master build).
  • I have checked the FAQ.
  • I have read Snoopy's documentation here and here.
  • I have searched Snoopy issues for an existing issue that matches my problem, and found none.

Issue description

Hi, Snoopy team! I have simple question.
How can I get only user typing commands for result. I have searched Snoopy docs like filter feature but cannot find the way.
Any comments will very helpful for me!!

Issue reproduction steps

Expected result

<FILLIN>

Actual result

<FILLIN>

@bostjan
Copy link
Member

bostjan commented Dec 8, 2023

Hey @youjeongsue.

I think what you're looking for is the only_tty filter.

The comments in the config file maybe really aren't the best in this regard (feel free to open a PR with improvements):
https://github.com/a2o/snoopy/blob/master/etc/snoopy.ini.in#L81

In short, configure Snoopy filtering as follows:

filter_chain = only_tty

This should do the trick. Can you report back if it works as expected?

@hatamiarash7
Copy link

This filter will only work when commands are run with sudo...it won't work when the user runs their normal commands.

sudo ls ---> logged
ls ---> not work

Is there a way to save normal commands as well?

@bostjan
Copy link
Member

bostjan commented Sep 8, 2024

@hatamiarash7, are you using the output = file:/path/to/your/logfile.log option?

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

No branches or pull requests

3 participants