upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/how-to/migration-scripts/validate-service.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docs/how-to/migration-scripts/validate-service.sh')
-rwxr-xr-xdocs/how-to/migration-scripts/validate-service.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/how-to/migration-scripts/validate-service.sh b/docs/how-to/migration-scripts/validate-service.sh
index 2525a3f..6988af3 100755
--- a/docs/how-to/migration-scripts/validate-service.sh
+++ b/docs/how-to/migration-scripts/validate-service.sh
@@ -108,9 +108,10 @@ validate_service_for_structured_logging() {
108 fi 108 fi
109 109
110 # Check for structured log entries 110 # Check for structured log entries
111 # IMPORTANT: Use --no-pager to prevent hanging when run non-interactively (e.g., via SSH)
111 local has_parse_fail has_purgatory 112 local has_parse_fail has_purgatory
112 has_parse_fail=$(journalctl -u "$service_name" --since "7 days ago" 2>/dev/null | grep -c '\[PARSE_FAIL\]' || echo "0") 113 has_parse_fail=$(journalctl --no-pager -u "$service_name" --since "7 days ago" 2>/dev/null | grep -c '\[PARSE_FAIL\]' || echo "0")
113 has_purgatory=$(journalctl -u "$service_name" --since "7 days ago" 2>/dev/null | grep -c '\[PURGATORY_EXPIRED\]' || echo "0") 114 has_purgatory=$(journalctl --no-pager -u "$service_name" --since "7 days ago" 2>/dev/null | grep -c '\[PURGATORY_EXPIRED\]' || echo "0")
114 115
115 # Strip any non-numeric characters (grep -c can have trailing whitespace) 116 # Strip any non-numeric characters (grep -c can have trailing whitespace)
116 has_parse_fail="${has_parse_fail//[^0-9]/}" 117 has_parse_fail="${has_parse_fail//[^0-9]/}"