# libtmux.json:write-filter

- **Package:** libtmux/json
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/json.lisp#L527
- **Public owner:** libtmux.json
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-json-write-filter/

```
(write-filter filter &key stream (pretty nil))
```

Serialize a COMPILED-FILTER as one libtmux.lisp.filter/1 JSON document.
Return a fresh string when STREAM is NIL; otherwise write to the supplied open
output character stream and return NIL without closing it. Pathnames and binary
streams are rejected. The wire contract is native to this port and does not
imply cross-port regex or query equivalence.

## Parameters

- `filter`
- `stream?`
- `pretty?`

## Guides

Pages that discuss `write-filter`.

- [Query interchange](/en/lisp/latest/topics/query-interchange/)
