{"id":366,"date":"2016-03-03T05:05:00","date_gmt":"2016-03-03T05:05:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/2016\/03\/03\/snoopy-get-set-and-log\/"},"modified":"2019-09-18T13:35:02","modified_gmt":"2019-09-18T08:05:02","slug":"snoopy-get-set-and-log","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2016\/03\/03\/snoopy-get-set-and-log\/","title":{"rendered":"Snoopy : Get, Set and log"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<p style=\"line-height:1.38;margin-bottom:6pt;margin-top:20pt;text-align:justify;\">Recently we got a requirement to log each and every command executed by the users. Upon googling we found a tool that is &nbsp;exclusively contrived to accomplish this ambition.<\/p>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">This tool was &#8220;Snoopy&#8221;. This is a open source project whose microscopic documentation is available at their github page:<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\"><a style=\"text-decoration:none;\" href=\"https:\/\/github.com\/a2o\/snoopy\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/a2o\/snoopy<\/a><\/div>\n<p><b style=\"font-weight:normal;\">&nbsp;<\/b><\/p>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">You can find all installation and configuration doc at their github README.<\/div>\n<h2 style=\"line-height:1.38;margin-bottom:6pt;margin-top:18pt;text-align:justify;\">Why snoopy?<\/h2>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">We choose snoopy because it is a very lightweight &nbsp;tool that is just built with the intention &nbsp;of logging each and every command executed by user. It consists of only a tiny library which does all the logging.<\/div>\n<h2 style=\"line-height:1.38;margin-bottom:6pt;margin-top:18pt;text-align:justify;\">Use cases:<\/h2>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">1). Log each executed command by any user with its arguments<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">2). Configure the pattern of logs according to requirement using a simple configuration file<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">3). The logs generated by snoopy can be sent to a central logging server and then can be parsed to get useful information. For example: To get all sudo commands executed by a user.<\/div>\n<h2 style=\"line-height:1.38;margin-bottom:6pt;margin-top:18pt;text-align:justify;\">About Snoopy:<\/h2>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">Snoopy logger is a majestic utility which makes the admin work more effortless by providing a log of commands with its arguments executed via shell by any user. It comes with a configuration file &#8220;\/etc\/snoopy.ini&#8221; where you can configure how the logs are generated and the information in the logs you want to have.<\/div>\n<h2 style=\"line-height:1.38;margin-bottom:6pt;margin-top:18pt;text-align:justify;\">Automating Snoopy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; installation\/configuration:<\/h2>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">We will make the procedure easy for installation and configuration of snoopy by creating puppet module and ansible role. We&#8217;ll soon be launching a puppet module and an ansible role for it.<\/div>\n<p><b style=\"font-weight:normal;\">&nbsp;<\/b><\/p>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:justify;\">Also we&#8217;ll showcase a useful example of snoopy logger with centralized logging using ELK.<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Recently we got a requirement to log each and every command executed by the users. Upon googling we found a tool that is &nbsp;exclusively contrived to accomplish this ambition. This tool was &#8220;Snoopy&#8221;. This is a open source project whose microscopic documentation is available at their github page: https:\/\/github.com\/a2o\/snoopy &nbsp; You can find all installation &hellip; <a href=\"https:\/\/opstree.com\/blog\/2016\/03\/03\/snoopy-get-set-and-log\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Snoopy : Get, Set and log&#8221;<\/span><\/a><\/p>\n","protected":false},"author":171775670,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[6504,676319247,768739296,28382,1097394],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-5U","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/366"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/171775670"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":3,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/366\/revisions"}],"predecessor-version":[{"id":1102,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/366\/revisions\/1102"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}