Sample SQL query for JSOB for logs

This commit is contained in:
marius 2023-05-06 13:42:24 +00:00
parent 929f6213ee
commit 5d992e89bd

View 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;