File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,26 @@ You can use basic Unix commands to check for patterns like pg_ functions directl
289289| Count occurrences of each function | `grep -oE '\bpg_[a-zA-Z0-9_]+\(' chunks/* \| sort \| uniq -c \| sort -nr` |
290290| Full SQL lines containing pg\_\* | `grep -E '\bpg_[a-zA-Z0-9_]+\(' chunks/*` |
291291
292+ ALso, before or after running `crdb-sql-audit`, you can inspect your logs to see how often common filters appear.
293+
294+ For example, to count usage of PostgreSQL built-ins and log patterns :
295+
296+ ` ` ` bash
297+ {
298+ echo "🔍 pg_* function usage:"
299+ grep -oE '\b pg_[a-zA-Z0-9_]+\( ' chunks/* | sort | uniq -c | sort -nr
300+ echo ""
301+ echo "🔍 PostgreSQL LOG prefixes:"
302+ grep -oE 'LOG: execute|LOG: statement:|LOG: duration:' chunks/* | sort | uniq -c | sort -nr
303+ }
304+ ` ` ` `
305+
306+ This will show counts of:
307+
308+ * Each ` pg_` function used (e.g. `pg_backend_pid(`)
309+ * Number of log lines using `LOG: execute`, `LOG: statement:`, and `LOG: duration:`
310+
311+ > ✅ Useful for checking whether your filters (`--filters`) are likely to match anything in the input.
292312
293313---
294314
You can’t perform that action at this time.
0 commit comments