3.5.3 How Do I Show All INSERT and UPDATE Queries That Failed?

3.5.3.1 Objectives
3.5.3.2 Example Execution
3.5.3.3 Discussion
3.5.3.4 Permissions Required
3.5.3.5 Tips and Tricks

Many useful information can be recored in the audit log files and also a considerable amount of it. However, how can someone easily filter this information and search for specific events, for instance in order to determine the possible cause of a problem.

For example, suppose that someone reported that some data changes are missing (INSERT or UPDATE queries failed) and you want to determine what might be the cause of those transaction failures. All queries are recorded to the audit log file, so you just need to get retrieve all queries of a given type that failed (with a MySQL Error) and analyze them.

This can be achieved using common 'grep' command line tools, but likely involves the use of very complex regular expression to filter the desired data. Fortunately, the mysqlauditgrep utility allows to perform this kind of task in a much easier and simple way, taking advantage of the knowledge of the structure and semantics of the audit log files.