<commit_before>---
title: "PuppetDB 4.4: Report wire format, version 8"
layout: default
canonical: "/puppetdb/latest/api/wire_format/report_format_v8.html"
---

## Report interchange format

A report is represented as JSON (this implies UTF-8 encoding). Unless otherwise
noted, `null` is not allowed anywhere in the report.

    {
        "certname": <string>,
        "environment": <string>,
        "puppet_version": <string>,
        "report_format": <int>,
        "configuration_version": <string>,
        "start_time": <datetime>,
        "end_time": <datetime>,
        "producer_timestamp": <datetime>,
        "producer": <string>,
        "resources": [<resource>, <resource>, ...],
        "metrics": [<metric>, <metric>, ...],
        "logs": [<log>, <log>, ...],
        "transaction_uuid": <string>,
        "catalog_uuid": <string>,
        "code_id": <string>,
        "job_id": <string>,
        "cached_catalog_status": <string>,
        "status": <string>,
        "noop": <boolean>,
        "corrective_change": <boolean>,
        "noop_pending": <boolean>
    }

All keys are mandatory unless otherwise noted, though values that are lists may be empty lists.

`"certname"` is the certname the report is associated with.

`"environment"` is the environment associated to the node at the time of the report.

`"puppet_version"` is the version of Puppet that was run to generate this report.

`"report_format"` is the version number of the report format that Puppet used
to generate the original report data. This is a constant defined by Puppet.

`"configuration_version"` is an identifier string that Puppet uses to match a
specific catalog for a node to a specific Puppet run. This value is
generated by Puppet.

`"start_time"` is the time on the agent at which the Puppet run began; see more
details about the `datetime` format below.

`"end_time"` is the time on the agent at which the Puppet run completed; see
more details about the `datetime` format below.

`"producer_timestamp"` is the time of catalog submission from the Puppet master to
PuppetDB. This field is currently populated by the Puppet master. See more details
about the `datetime` format below.

`"producer"` is the certname of the Puppet master that sent the report to
PuppetDB. This field may be `null`.

`"transaction_uuid"` is a string used to identify a Puppet run. It can be used to
match a report with the catalog that was used for the run. This field may be `null`.

`"catalog_uuid"` is a string used to identify the catalog used to generate a
report during a Puppet run. It can be used to match a report with the catalog
that was used for the run. This field may be `null`.

`"code_id"` is a string used to match the catalog with the Puppet code which
generated the report. This field may be `null`.

`"job_id"` is a string used to match a report to a Puppet run initiated by the
Puppet Enterprise Orchestrator.

`"cached_catalog_status"` is a string used to identify whether the Puppet run
used a cached catalogs and whether or not the cached catalog was used due to an
error or not. This field may be `null`.

`"status"` is a string used to identify the status of the Puppet run.

`"noop"` is a flag that indicates whether the report was produced with a `--noop` run.

`"noop_pending"` is a flag that indicates whether the report contained "noop"
events. These may result from use of the `--noop` flag, or from resources
tagged with the `noop` parameter. This field may be `null`.

`"corrective_change"` is a flag that indicates whether the report contained changes
to correct configuration drift. This field may be `null`.

`"resources"` is an array of objects of the following form:


    {
      "timestamp": <timestamp (from agent) when the resource was managed>,
      "resource_type": <type of resource>,
      "resource_title": <title of resource>,
      "skipped" : <boolean for whether or not the resource was skipped>,
      "events" : [<event>, <event>, ...]
      "file": <manifest file containing resource definition>,
      "line": <line in manifest file on which resource is defined>,
      "containment_path": <containment heirarchy of resource within catalog>
    }

In each `<resource>` object `"events"` is an array of objects of the following form:

    {
      "status": <status of event (`success`, `failure`, `noop`)>,
      "timestamp": <timestamp (from agent) at which event occurred>,
      "property": <property/parameter of resource on which event occurred>,
      "new_value": <new value for resource property>,
      "old_value": <old value of resource property>,
      "message": <description of what happened during event>,
      "corrective_change": <flag indicating whether the event corrected system drift>
    }

`"metrics"` is either null or an array of metric objects:

    {
      "category" : <category of metric ("resources", "time", "changes", or "events")>,
      "name" : <name of the metric>,
      "value" : <value of the metric (double precision)>
    }

`"logs"` is either null or an array of log objects:

    {
      "file" : <file of resource declaration>,
      "line" : <line of resource declaration>,
      "level" : <log level>,
      "message" : <log message>,
      "source" : <log source>,
      "tags" : [<resource tag>],
      "time" : <log line timestamp>
     }

>**Note: Fields that allow `NULL` values**
>In the resource_event schema above, `containment_path`, `new_value`, `old_value`,
`property`, `file`, `line`, `status`, `corrective_change`, and `message` may all be null.

### Encoding

The entire report is expected to be valid JSON, which implies UTF-8
encoding.

### Data type: `<string>`

A JSON string. By virtue of the report being UTF-8, these must also
be UTF-8.

### Data type: `<integer>`<commit_msg>(maint) reformat report wireformat docs<commit_after>---
title: "PuppetDB 4.4: Report wire format, version 8"
layout: default
canonical: "/puppetdb/latest/api/wire_format/report_format_v8.html"
---

## Report interchange format

A report is represented as JSON (this implies UTF-8 encoding). Unless otherwise
noted, `null` is not allowed anywhere in the report.

    {
        "certname": <string>,
        "environment": <string>,
        "puppet_version": <string>,
        "report_format": <int>,
        "configuration_version": <string>,
        "start_time": <datetime>,
        "end_time": <datetime>,
        "producer_timestamp": <datetime>,
        "producer": <string>,
        "resources": [<resource>, <resource>, ...],
        "metrics": [<metric>, <metric>, ...],
        "logs": [<log>, <log>, ...],
        "transaction_uuid": <string>,
        "catalog_uuid": <string>,
        "code_id": <string>,
        "job_id": <string>,
        "cached_catalog_status": <string>,
        "status": <string>,
        "noop": <boolean>,
        "corrective_change": <boolean>,
        "noop_pending": <boolean>
    }

All keys are mandatory unless otherwise noted, though values that are lists may be empty lists.

#### `certname`

String. The certname the report is associated with.

#### `environment`

String. The environment associated to the node at the time of the report.

#### `puppet_version`

String. The version of Puppet that was run to generate this report.

#### `report_format`

Integer. The version number of the report format that Puppet used to generate
the original report data. This is a constant defined by Puppet.

#### `configuration_version`

String. An identifier that Puppet uses to match a specific catalog for a node
to a specific Puppet run. This value is generated by Puppet.

#### `start_time`

DateTime. The time on the agent at which the Puppet run began; see more details
about the `datetime` format below.

#### `end_time`

DateTime. The time on the agent at which the Puppet run completed; see
more details about the `datetime` format below.

#### `producer_timestamp`

DateTime. The time of catalog submission from the Puppet master to
PuppetDB. This field is currently populated by the Puppet master. See more details
about the `datetime` format below.

#### `producer`

String. The certname of the Puppet master that sent the report to
PuppetDB. This field may be `null`.

#### `transaction_uuid`

String. A string used to match the report to a Puppet run, and when not using
cached catalogs, to its corresponding catalog. This field may be `null`.

#### `catalog_uuid`

String. A string used to identify the report with the catalog that generated
it, when using cached ctalogs. This field may be `null`.

#### `code_id`

String. A string used to match the catalog with the Puppet code that generated
it. For example, a git sha. This field may be `null`.

#### `job_id`

String. A string used to match a report to a Puppet run initiated by the Puppet
Enterprise Orchestrator.

#### `cached_catalog_status`

String. Used to represent whether the Puppet run used a cached catalogs and
whether or not the cached catalog was used due to an error or not. This field
may be `null`.

#### `status`

String. The status of the Puppet run.

#### `noop`

Boolean. Indicates whether the report was resulted from a `noop` Puppet run.

#### `noop_pending`

Boolean. A flag indicating whether the report contained "noop" events. These
may result from use of the `--noop` flag, or from resources tagged with the
`noop` parameter. This field may be `null`.

#### `corrective_change`

Boolean. A flag indicating whether the report contained changes to correct
configuration drift. This field may be `null`.

#### `resources`

Array. An array of objects of the following form:


    {
      "timestamp": <timestamp (from agent) when the resource was managed>,
      "resource_type": <type of resource>,
      "resource_title": <title of resource>,
      "skipped" : <boolean for whether or not the resource was skipped>,
      "events" : [<event>, <event>, ...]
      "file": <manifest file containing resource definition>,
      "line": <line in manifest file on which resource is defined>,
      "containment_path": <containment heirarchy of resource within catalog>
    }

In each `<resource>` object `"events"` is an array of objects of the following form:

    {
      "status": <status of event (`success`, `failure`, `noop`)>,
      "timestamp": <timestamp (from agent) at which event occurred>,
      "property": <property/parameter of resource on which event occurred>,
      "new_value": <new value for resource property>,
      "old_value": <old value of resource property>,
      "message": <description of what happened during event>,
      "corrective_change": <flag indicating whether the event corrected system drift>
    }

#### `metrics`

Array. An array of metric objects (below) or null.

    {
      "category" : <category of metric ("resources", "time", "changes", or "events")>,
      "name" : <name of the metric>,
      "value" : <value of the metric (double precision)>
    }

#### `logs`

Array. An array of log objects (below) or null.

    {
      "file" : <file of resource declaration>,
      "line" : <line of resource declaration>,
      "level" : <log level>,
      "message" : <log message>,
      "source" : <log source>,
      "tags" : [<resource tag>],
      "time" : <log line timestamp>
     }

>**Note: Fields that allow `NULL` values**
>In the resource_event schema above, `containment_path`, `new_value`, `old_value`,
`property`, `file`, `line`, `status`, `corrective_change`, and `message` may all be null.

### Encoding

The entire report is expected to be valid JSON, which implies UTF-8
encoding.

### Data type: `<string>`

A JSON string. By virtue of the report being UTF-8, these must also
be UTF-8.

### Data type: `<integer>`
{'fraction_non_alphanumeric': 0.11074026529738981, 'fraction_numerical': 0.0013692768506632434, 'mean_word_length': 3.5630613041780554, 'pattern_counts': {'":': 68, '<': 109, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2556403', 'n_tokens_mistral': 3313, 'n_tokens_neox': 3231, 'n_words': 1499}