Skip to content

Instantly share code, notes, and snippets.

View adamfeldman's full-sized avatar
🎉
Clojure & Distributed Systems

Adam Feldman adamfeldman

🎉
Clojure & Distributed Systems
View GitHub Profile
@kematzy
kematzy / kematzy.hasura.audit_trail.sql
Last active January 29, 2024 17:48
Hasura AuditTrail by Kematzy
-- ## Kematzy Hasura AuditTrail
-- This is based on the [Hasura/audit-trigger](https://github.com/hasura/audit-trigger).
--
-- Changes from the Hasura version:
-- 1. Simplified audit table schema with these changes:
-- a. Renamed columns to lowerFirst format.
-- b. Changed order of columns.
-- c. Combined schema & table name into one column.
-- d. Stores the record `id` UUID value in the `rowId` column.
@leandrosilva
leandrosilva / README
Last active March 17, 2023 19:05
Parsing Syslog files with Python and PyParsing
$ python xlog.py sample.log
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68898', 'priority': '132', 'message': 'bla bla bla warn'}
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68902', 'priority': '131', 'message': 'bla bla bla error'}
{'appname': 'Dock', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '154', 'priority': '11', 'message': 'CGSReleaseWindowList: called with 5 invalid window(s)'}
{'appname': 'WindowServer', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '79', 'priority': '11', 'message': 'CGXSetWindowListAlpha: Invalid window 0'}
$ python xlog.py sample.log | grep test.app
{'priority': '132', 'timestamp': '2020-03-04 12:42:40', 'hostname': 'codezone.local', 'appname': 'test.app', 'pid': '68898', 'message': 'bla bla bla warn'}