{
  "id": "service/systemctl-status",
  "family": "service-state",
  "description": "Compact systemctl status output while preserving active state and failure lines.",
  "match": {
    "toolNames": ["exec"],
    "argv0": ["systemctl"],
    "argvIncludes": [["status"]]
  },
  "transforms": {
    "stripAnsi": true,
    "dedupeAdjacent": true,
    "trimEmptyEdges": true
  },
  "filters": {
    "keepPatterns": [
      "^●\\s+.+",
      "^\\s*(Loaded|Active|Main PID|Tasks|Memory|CPU):",
      "error|failed|inactive|dead|back-off|timeout|refused|warning",
      "^\\s*Process:\\s+.+",
      "^\\s*Docs:\\s+.+"
    ]
  },
  "summarize": {
    "head": 8,
    "tail": 8
  },
  "failure": {
    "preserveOnFailure": true,
    "head": 10,
    "tail": 10
  },
  "counters": [
    {
      "name": "warning",
      "pattern": "warning|back-off|timeout|refused",
      "flags": "i"
    },
    {
      "name": "error",
      "pattern": "failed|inactive|dead|error",
      "flags": "i"
    }
  ]
}
