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

Cool MySQL example. #35

Closed
SchizoDuckie opened this issue Apr 4, 2014 · 4 comments
Closed

Cool MySQL example. #35

SchizoDuckie opened this issue Apr 4, 2014 · 4 comments

Comments

@SchizoDuckie
Copy link

I'm not allowed to add examples to the wiki, so i thought i'd share this.

Monitor all traffic between apache and mysql and dump the SELECT queries it executes

sysdig -A -c echo_fds fd.sip=192.168.30.5 and proc.name=apache2 | grep SELECT

@kristopolous
Copy link
Contributor

hey this one's pretty clever. nice going.

@gianlucaborello
Copy link
Contributor

Great!

Now let's get rid of that "ugly" grep:

sysdig -A -c echo_fds fd.sip=192.168.30.5 and proc.name=apache2 and evt.buffer contains SELECT

Much better output, right?

PS: You can also control the size of the captured buffer this way, take a look at sysdig --help

@gianlucaborello
Copy link
Contributor

I also just opened the wiki permissions so feel free to add a new example (the less you pipe sysdig output to other tools the more you score points :))

Thanks!

@ldegio
Copy link
Contributor

ldegio commented Apr 4, 2014

By the way,it can still be improved a little bit if you need to see more than 80 bytes of each buffer:

sysdig -s 2000 -A -c echo_fds fd.sip=192.168.30.5 and proc.name=apache2 and evt.buffer contains SELECT

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

4 participants