{
  "slug": "json-from-logs",
  "name": "gizza-ai/json-from-logs",
  "version": "0.1.0",
  "title": "Extract JSON from Logs — gizza.ai",
  "description": "Paste mixed log or console text and extract embedded JSON objects and arrays — validated, pretty-printed, and separated into blocks in your browser.",
  "tags": [
    "extract json from logs",
    "find json in text",
    "json log extractor",
    "parse json from console output",
    "embedded json extractor",
    "pull json objects from text",
    "log json parser",
    "pretty print json from logs"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/json-from-logs/",
    "markdown": "https://gizza.ai/tools/json-from-logs/index.md",
    "descriptor": "https://gizza.ai/tools/json-from-logs/tool.json",
    "deep_link_example": "https://gizza.ai/tools/json-from-logs/?text=2026-07-24%2010%3A12%3A01%20INFO%20%20starting%20worker%0A2026-07-24%2010%3A12%3A02%20DEBUG%20state%3D%7B%22user%22%3A%22gizza%22%2C%22retries%22%3A0%2C%22ok%22%3Atrue%7D%0A2026-07-24%2010%3A12%3A03%20INFO%20%20batch%20ids%20%5B1%2C%202%2C%203%5D%20queued&indent=2&output=blocks"
  },
  "cli": "gizza tool json-from-logs '2026-07-24 10:12:01 INFO  starting worker\n2026-07-24 10:12:02 DEBUG state={\"user\":\"gizza\",\"retries\":0,\"ok\":true}\n2026-07-24 10:12:03 INFO  batch ids [1, 2, 3] queued'",
  "tool": {
    "description": "Scan mixed log or console text and pull out every embedded JSON object/array, validating each with a strict JSON parser and pretty-printing it separately. Brace-matches balanced {…}/[…] runs anywhere in the text (e.g. a state={…} fragment on a log line), so surrounding prose and non-JSON braces are ignored; only runs that actually parse are kept and nested JSON isn't double-extracted. indent is spaces per level (0-8, default 2; 0 minifies each block). output='blocks' (default) prints each block under a '// block N (line L)' header; output='array' wraps all blocks into one JSON array. Errors if no valid JSON block is found. Runs locally.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "indent": {
          "default": 2,
          "description": "Spaces of indentation per level for each extracted block (0-8). Use 0 to minify each block to one compact line. Default 2.",
          "maximum": 8,
          "minimum": 0,
          "type": "integer"
        },
        "output": {
          "default": "blocks",
          "description": "Output shape. 'blocks' (default) prints each extracted JSON block separately under a '// block N (line L)' header; 'array' wraps every extracted block into one pretty-printed JSON array.",
          "enum": [
            "blocks",
            "array"
          ],
          "type": "string"
        },
        "text": {
          "description": "The raw log or console text to scan. Embedded JSON objects/arrays are found anywhere in the text (e.g. a `state={...}` fragment on a log line); surrounding prose is ignored.",
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  }
}