{"action":"created","issue":{"url":"https://api.github.com/repos/mcafee/mysql-audit/issues/102","labels_url":"https://api.github.com/repos/mcafee/mysql-audit/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/mcafee/mysql-audit/issues/102/comments","events_url":"https://api.github.com/repos/mcafee/mysql-audit/issues/102/events","html_url":"https://github.com/mcafee/mysql-audit/issues/102","id":56910546,"number":102,"title":"Config to limit logged cmd size? ","user":{"login":"technomagos","id":1209038,"avatar_url":"https://avatars.githubusercontent.com/u/1209038?v=3","gravatar_id":"","url":"https://api.github.com/users/technomagos","html_url":"https://github.com/technomagos","followers_url":"https://api.github.com/users/technomagos/followers","following_url":"https://api.github.com/users/technomagos/following{/other_user}","gists_url":"https://api.github.com/users/technomagos/gists{/gist_id}","starred_url":"https://api.github.com/users/technomagos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technomagos/subscriptions","organizations_url":"https://api.github.com/users/technomagos/orgs","repos_url":"https://api.github.com/users/technomagos/repos","events_url":"https://api.github.com/users/technomagos/events{/privacy}","received_events_url":"https://api.github.com/users/technomagos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mcafee/mysql-audit/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-07T12:59:37Z","updated_at":"2015-02-15T11:57:32Z","closed_at":null,"body":"First of all, thanks for the great work!\r\n\r\nCould we have a simple config flag that limits the size of command text (in bytes) that would be logged to the output stream:\r\n audit_cmd_limit=2048\r\n\r\nE.g. if one needs to log insert commands, and some of the inserts are multi-mbyte multi-value inserts (oftenc of blog dat), the log will \r\n\r\nThis is v easy to hack into the current code, but would be v useful to support as std config in the plugin\r\n\r\n---\r\n\r\nOne more suggestion, which is a bit more work, but should improve performance a lot is:\r\n\r\nHave a rotating buffer where log msgs are placed (of configurable maxsize/maxtime settings, that control flushing), make it run in another thread, so there is near zero blockage for audit logging to the server. Also set a max mem limit so the audit plugin does not make the server crawl e.g. on high load when the flush may not be able to catch up with an unusually high stream of log cmds. \r\n\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/mcafee/mysql-audit/issues/comments/74414629","html_url":"https://github.com/mcafee/mysql-audit/issues/102#issuecomment-74414629","issue_url":"https://api.github.com/repos/mcafee/mysql-audit/issues/102","id":74414629,"user":{"login":"technomagos","id":1209038,"avatar_url":"https://avatars.githubusercontent.com/u/1209038?v=3","gravatar_id":"","url":"https://api.github.com/users/technomagos","html_url":"https://github.com/technomagos","followers_url":"https://api.github.com/users/technomagos/followers","following_url":"https://api.github.com/users/technomagos/following{/other_user}","gists_url":"https://api.github.com/users/technomagos/gists{/gist_id}","starred_url":"https://api.github.com/users/technomagos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technomagos/subscriptions","organizations_url":"https://api.github.com/users/technomagos/orgs","repos_url":"https://api.github.com/users/technomagos/repos","events_url":"https://api.github.com/users/technomagos/events{/privacy}","received_events_url":"https://api.github.com/users/technomagos/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T11:57:32Z","updated_at":"2015-02-15T11:57:32Z","body":"Thanks for your quick reply\r\n\r\nThe multi-insert sample is simple: we have an application which collects/computes a lot of data and performs bulk inserts of those into a DB table of up to a few thousand rows; a bit like this:\r\n\r\n  INSERT Into MyTable (F1, F2, F3, F4) VALUES ( 'tag1', 1,2, 20, 3, 1), ( 'tag2', 2,2, 30, 4, 2), ( 'tag3', 5, 10, 1, 0), ....  ( a few thousand times)\r\n\r\nAs you probably know that mysql insertion is a lot faster with bulk multi-insert.statements.\r\n\r\nAnother case could be 'separate' multi statements, e.g. UPDATEs bulked up as well (sent as single sql) as :\r\n  UPDATE myTable Set  F2=12  WHERE F1 = 'Tag1';\r\n  UPDATE myTable Set  F2=13, F3=1 WHERE F1 = 'Tag2';\r\n....  ( a few thousand times)\r\n\r\nNot sure if the latter case arrives to the plugin as a single bulk stmt or many separate ones? But the former arrives as a single.\r\n\r\nLooking fwd to your new releases.\r\n\r\nBtw, if i may be allowed a suggestion for one more future enhancement: we do seem to have a need for monitoring separate types of statements (or whitelist) for different DB users. Looks like this is not supported now and the only way is to monitor same statements for all users and post filter; but i assume this is slower for the audit plugin.\r\n\r\n"}}