# Read a Mattermost Bulk Export

Paste a Mattermost bulk export (import.jsonl) and get a readable per-channel transcript with resolved authors, timestamps, threads and a summary. Runs locally.

## Run it

- **CLI:** `gizza tool mattermost-export-reader '{"type":"post","post":{"team":"core","channel":"town-square","user":"alice","message":"Standup in five","create_at":1705311000000}}'`
- **Web:** https://gizza.ai/tools/mattermost-export-reader/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/mattermost-export-reader/tool.json

## Inputs

- `export` — Mattermost export (JSONL) _(field)_
- `output` — Output _(field)_
- `format` — Format _(field)_
- `channel` — Channel filter _(field)_
- `user_filter` — Author filter _(field)_
- `since` — From date (UTC, inclusive) _(field)_
- `until` — To date (UTC, inclusive) _(field)_
- `include_direct_messages` — Include direct messages _(field)_
- `include_replies` — Include thread replies _(field)_
- `max_messages` — Max messages (0 = all) _(field)_

## Output

- Transcript / summary (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `export` — Mattermost export (JSONL)
- `output` — Output
- `format` — Format
- `channel` — Channel filter
- `user_filter` — Author filter
- `since` — From date (UTC, inclusive)
- `until` — To date (UTC, inclusive)
- `include_direct_messages` — Include direct messages
- `include_replies` — Include thread replies
- `max_messages` — Max messages (0 = all)

Example: `https://gizza.ai/tools/mattermost-export-reader/?export=%7B%22type%22%3A%22post%22%2C%22post%22%3A%7B%22team%22%3A%22core%22%2C%22channel%22%3A%22town-square%22%2C%22user%22%3A%22alice%22%2C%22message%22%3A%22Standup%20in%20five%22%2C%22create_at%22%3A1705311000000%7D%7D&output=both&format=text&channel=town-square&user_filter=alice&since=2024-01-15&until=2024-01-31&include_direct_messages=true&include_replies=true&max_messages=0`

---

## What this tool does

Paste the `import.jsonl` file from a Mattermost bulk export and get a readable transcript you can review, archive, search or hand to a migration/audit workflow. The conversion is deterministic and local: the JSON Lines file is parsed in your browser, display names are resolved from the export's user records, and channel posts, direct messages, replies, reactions and attachments are rendered without uploading the archive anywhere.

Mattermost's bulk export is built for imports, not humans. Each line is a separate object tagged with a `type` such as `version`, `team`, `channel`, `user`, `post`, `direct_channel` or `direct_post`. This tool indexes the metadata first, then renders the message records with UTC timestamps and friendly labels.

## Worked example

Input — a small Mattermost JSONL export:

```jsonl
{"type":"version","version":1}
{"type":"channel","channel":{"team":"core","name":"town-square","display_name":"Town Square","type":"O"}}
{"type":"user","user":{"username":"alice","first_name":"Alice","last_name":"Anderson"}}
{"type":"user","user":{"username":"bob","nickname":"Bobby"}}
{"type":"post","post":{"team":"core","channel":"town-square","user":"alice","message":"Standup in five","create_at":1705311000000,"reactions":[{"user":"bob","emoji_name":"thumbsup"}],"replies":[{"user":"bob","message":"On my way","create_at":1705311120000}]}}
```

Output — summary plus transcript:

```text
Bulk export format version: 1
Channels in export: 1
Users in export: 2
Messages after filters: 2

--- #town-square (Town Square) ---

[2024-01-15 09:30:00 UTC] Alice Anderson: Standup in five [reactions: :thumbsup:]
    ↳ [2024-01-15 09:32:00 UTC] Bobby: On my way
```

## Options

| Option | What it does |
| --- | --- |
| **Output** | Choose transcript only, summary only, or both. |
| **Format** | Plain text, Markdown, escaped HTML, or CSV rows for spreadsheets and downstream scripts. |
| **Channel filter** | Keep one channel by name or display name. A leading `#` is ignored. Direct messages are excluded while a channel filter is active. |
| **Author filter** | Keep messages by username or resolved display name, case-insensitive. A leading `@` is ignored. |
| **From / To date** | Inclusive UTC date bounds in `YYYY-MM-DD` form, compared against each message's timestamp. |
| **Include direct messages** | On by default; turns `direct_post` lines into "Direct message: Alice, Bob" transcript sections. |
| **Include thread replies** | On by default; replies are nested under their root post. Turn off for root posts only. |
| **Max messages** | Chronological cap after filtering. `0` means no cap; use a small number to preview a large export. |

## Limits & edge cases

- **Input shape:** paste the text contents of `import.jsonl`, not the `.zip`/`.tar` archive. Extract the archive first and open the JSONL file as text.
- **Timestamps are UTC.** Mattermost stores `create_at` as Unix milliseconds; this tool renders UTC dates and times so filtering is reproducible.
- **Unknown records are ignored.** Newer Mattermost export line types do not break the transcript. Malformed JSON, missing `type` fields and reversed date bounds produce explicit errors.
- **Attachments are referenced, not downloaded.** The transcript includes `[attachment: path]` placeholders from the export metadata. It does not unpack or fetch files.
- **No deleted/edited-message recovery.** The export only contains what Mattermost wrote into the bulk export. This tool does not query a server or reconstruct history outside that file.
- **Large exports can be heavy in the browser.** Use filters and the max-message cap to preview, then remove the cap for the final transcript.

## FAQ

<details>
<summary>How do I get the file this tool expects?</summary>

Run or download a Mattermost bulk export, extract the archive, and open the `import.jsonl` file inside it. Paste that file's text here. The tool expects JSON Lines: one JSON object per line, each with a `type` field.

</details>

<details>
<summary>Can I paste the whole export archive?</summary>

No. Archives contain files plus the JSONL metadata, and this browser tool intentionally avoids archive/file-system unpacking. Extract the archive first and paste only `import.jsonl`.

</details>

<details>
<summary>Does this include direct messages and thread replies?</summary>

Yes by default. Direct messages become their own transcript sections labelled by members, and replies are nested under their parent message. You can turn either off with the checkboxes.

</details>

<details>
<summary>How are author names resolved?</summary>

User records are indexed before rendering messages. The display label prefers nickname, then first + last name, and finally username if no friendly name is present. Filters match either username or the resolved display label.

</details>

<details>
<summary>What does CSV format contain?</summary>

Transcript CSV uses `timestamp,channel,author,username,kind,message`. Summary CSV uses `section,key,value` rows for totals plus per-channel and per-author tallies. Cells with commas, quotes or newlines are quoted.

</details>

<details>
<summary>Are my Mattermost messages uploaded?</summary>

No. The parser runs locally in WebAssembly in your browser. The page does not need an account or a Mattermost server connection, and it never sends the export contents anywhere.

</details>

## Related tools

- [CSV timeline viewer](https://gizza.ai/tools/csv-timeline-viewer/): Paste a CSV, TSV or JSON Lines event log and filter it by time range, search every column, sort, pick columns and page through the matches locally.
- [Format and filter structured JSON logs](https://gizza.ai/tools/json-log-formatter/): Pretty-print JSON log lines, flatten nested fields, filter by level or field, and export readable logs as text, table, JSON, or CSV.
- [JSONL stats](https://gizza.ai/tools/jsonl-stats/): Summarize JSON Lines records: record count, per-key coverage, value-type distribution, distinct counts, samples, and numeric/string stats.
- [NDJSON to matrix](https://gizza.ai/tools/ndjson-to-matrix/): Turn NDJSON / JSON Lines records into one aligned table: unified columns from dotted paths, chosen fill for missing cells, CSV, TSV, matrix or JSON out.
- [Read a Telegram result.json Export](https://gizza.ai/tools/telegram-export-reader/): Paste a Telegram Desktop result.json export and get a clean transcript, per-sender message and word stats, top words and emoji. Runs locally.
