Sample SQL query for JSOB for logs
This commit is contained in:
parent
929f6213ee
commit
5d992e89bd
10
postgre/queries/jsonb_logs.sql
Normal file
10
postgre/queries/jsonb_logs.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SELECT
|
||||||
|
log_data->>'timestamp' AS timestamp,
|
||||||
|
log_data->>'message' AS message,
|
||||||
|
log_data->>'host' AS host,
|
||||||
|
log_data->>'severity' AS severity,
|
||||||
|
log_data->>'facility' AS facility,
|
||||||
|
log_data->>'syslogtag' AS syslogtag
|
||||||
|
FROM logs
|
||||||
|
ORDER BY (log_data->>'timestamp')::timestamptz DESC
|
||||||
|
LIMIT 10;
|
Loading…
Reference in New Issue
Block a user