{
  "slug": "log-to-table",
  "name": "gizza-ai/log-to-table",
  "version": "0.1.0",
  "title": "Log to Table — Parse Logs with Regex Presets — gizza.ai",
  "description": "Turn semi-structured log lines into a Markdown table, CSV, TSV, or JSON using named regex groups and presets for Apache, syslog, and log4j-style logs.",
  "tags": [
    "log parser",
    "log to csv",
    "log to table",
    "regex log parser",
    "apache log parser",
    "syslog parser",
    "log4j parser",
    "parse logs"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/log-to-table/",
    "markdown": "https://gizza.ai/tools/log-to-table/index.md",
    "descriptor": "https://gizza.ai/tools/log-to-table/tool.json",
    "deep_link_example": "https://gizza.ai/tools/log-to-table/?logs=ERROR%2042%20failed%20to%20connect%0AINFO%207%20retry%20scheduled&preset=custom&pattern=%5E%28%3FP%3Clevel%3E%5Cw%2B%29%20%28%3FP%3Ccode%3E%5Cd%2B%29%20%28%3FP%3Cmessage%3E.%2A%29%24&output=table&header=true&on_nomatch=skip&limit=500"
  },
  "cli": "gizza tool log-to-table \"ERROR 42 failed to connect\nINFO 7 retry scheduled\"",
  "tool": {
    "description": "Parse semi-structured log lines into a table, CSV, TSV, or JSON using a regex template whose named capture groups (?P<name>...) define the columns. Pick a preset (common/combined Apache access logs, syslog, log4j) for a ready-made regex, or preset='custom' with your own 'pattern'. output='table' (default) renders an aligned Markdown table; header toggles the header row; on_nomatch handles lines that don't match (skip/keep/error); limit caps rows (default 500).",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "header": {
          "default": true,
          "description": "Include a header row of column names (table/csv/tsv). Default true. JSON always keys by column name.",
          "type": "boolean"
        },
        "limit": {
          "default": 500,
          "description": "Maximum number of rows to output (1-5000). Default 500.",
          "maximum": 5000,
          "minimum": 1,
          "type": "integer"
        },
        "logs": {
          "description": "The raw log text — one entry per line. Blank lines are ignored.",
          "type": "string"
        },
        "on_nomatch": {
          "default": "skip",
          "description": "What to do with a line that does not match the pattern. 'skip' (default) drops it (counted in the caption); 'keep' emits a row with the raw line in an 'unparsed' column; 'error' fails on the first non-matching line.",
          "enum": [
            "skip",
            "keep",
            "error"
          ],
          "type": "string"
        },
        "output": {
          "default": "table",
          "description": "Output shape. 'table' (default) is an aligned Markdown table with a row-count caption; 'csv' and 'tsv' are RFC-4180-quoted delimited text; 'json' is an array of one object per line.",
          "enum": [
            "table",
            "csv",
            "tsv",
            "json"
          ],
          "type": "string"
        },
        "pattern": {
          "default": "",
          "description": "A regular expression whose named capture groups (?P<name>...) become the table columns, in order. Required when preset='custom'; ignored otherwise. Example: ^(?P<ip>\\S+) (?P<status>\\d{3}) (?P<path>\\S+)$. No backreferences/lookaround (linear-time engine).",
          "type": "string"
        },
        "preset": {
          "default": "custom",
          "description": "Format preset supplying a ready-made regex. 'custom' (default) uses your own 'pattern'; 'common' = Apache/nginx Common Log Format; 'combined' = Combined (common + referer + user-agent); 'syslog' = RFC 3164; 'log4j' = 'YYYY-MM-DD HH:MM:SS LEVEL logger - message'.",
          "enum": [
            "custom",
            "common",
            "combined",
            "syslog",
            "log4j"
          ],
          "type": "string"
        }
      },
      "required": [
        "logs"
      ],
      "type": "object"
    }
  }
}