---
title: "oz0 audit export"
description: "Export one hash chain of the audit log as JSON lines: a tenant's with --tenant, the cluster's own without."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/audit/export"
---
# oz0 audit export

> Export one hash chain of the audit log as JSON lines: a tenant's with --tenant, the cluster's own without.

For: Operators and developers looking up a command.

Export one hash chain of the audit log as JSON lines: a tenant's with --tenant, the cluster's own without. Each line carries the entry, its place in the chain and its hashes, and the last line is the chain's head, so `audit verify --file` checks an export without the cluster.

Without the content permission, each entry's private part (what a job read or wrote) is left out and its hash kept, and the digests in its detail are keyed for this one export, so they cannot confirm a guess of what they cover: equal digests stay equal within the export. Such an entry is marked blinded and has no salt, which would confirm a guess too.

Every export's head is signed with the audit key, which stands in for what such an entry's hashes would show and says whose the export is. The export is recorded in the chain (audit.export).

With --follow the command keeps running and writes new entries as they come, each batch followed by a head line, for a SIEM to read; the session is recorded once (audit.follow), not at every poll.

## Usage

```bash
oz0 audit export [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --after
      </code>
    </td>
    
    <td>
      int
    </td>
    
    <td>
      
    </td>
    
    <td>
      only entries after this seq, such as the last one of an earlier export
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --cluster
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      export the cluster's own chain
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --follow
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      keep running and write new entries as they are recorded
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --output
      </code>
      
       (<code>
        -o
      </code>
      
      )
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      write to this file instead of stdout
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --since
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      only entries recorded at or after this time (RFC 3339)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the cluster's own, for cluster admins
      </code>
    </td>
    
    <td>
      export this tenant's chain
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --until
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      only entries recorded before this time (RFC 3339)
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
