---
title: Output Processors
slug: litmusedge/output-processors
docTags: 
createdAt: 2024-08-06T18:51:34.816Z
---

The Analytics module uses built-in output processors to write the results of Statistical Functions and KPIs to a topic or database.

:::hint{type="info"}
**Note**: To add one of these processors to a flow, see [Add Processors and Processor Connections](docId\:V37iAOLFGYw_7gLaZJt1n).
:::

## Database Output

Publishes all inputs to a specified database metric.

Configure the following parameters to control where results are published in the database.

| **Parameters** | **Details**                                             |
| -------------- | ------------------------------------------------------- |
| Database       | If left empty, the processor uses the default database. |
| Measurement    | Name of the measurement to publish.                     |
| Typed          | Publish typed name.                                     |

:::hint{type="info"}
**Note:** The *Measurement* parameter is a required field.
:::

## DataHub Publish

Publishes events from input to a specified DataHub topic. The processor supports Event wire types. You can use static topic publishing, where all input publishes to one topic that you define. With dynamic topic publishing, the processor evaluates **Topic** as an expression and builds a topic for each message from values in that message.

Configure the following parameters to control which DataHub topic results are published to.

| **Parameters** | **Details**                                                                                                                                                                                                                                      |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Topic          | The DataHub topic to publish to, or the expression that builds the topic when **Dynamic Topic&#x20;**&#x69;s selected.                                                                                                                           |
| Single Topic   | Publishes every input to the static **Topic** value defined in here. Clear this option to append the source instance ID of each incoming message to **Topic**, which produces `<Topic>.<instance ID>`.  **Single Topic** is enabled by default.  |
| Dynamic Topic  | Considers the **Topic** value as an expression and evaluates it before each publish, so the topic can be built from the incoming payload. Clear this option to use **Topic** as a literal string.                                                |

## FileWriter

Converts input data to a specified format and writes it to a file:

- The processor can append to the end of the file, replace the existing content, or delete the file.
- If you enable the **Generate Filename From Expression** option, the processor evaluates the filename as an expression. For example, to get the filename from the `path` and `name` properties of incoming connection `AAA`, your expression could be `AAA_path + AAA_name + ".txt"`. Static text in expressions must be in quotes.
- The **Timer Interval in Seconds** parameter acts as a "re-write file on timer" option. This is useful if you want to keep generating new file names after every few intervals.
- If **Output File Type** is set to **value only**, the processor saves incoming data from the `value` payload field as is.
- If **Output File Type** is set to **CSV**, the following options affect the output:
  - **CSV Comma** is the CSV file delimiter (only the first character entered is used).
  - **CSV Header** controls whether column names are included.
  - **CSV Columns From Payload** controls whether column names are generated from the payload.
  - **CSV Custom Columns** is a comma-separated list of column names (overrides **CSV Columns From Payload**).
- If **Output File Type** is set to **Parquet**, the processor rewrites the output file on each incoming payload. If **Write File Method** is set to append, the processor writes the last **Parquet Buffer Capacity** records to the file.

Configure the following parameters to control how output is written to a file.

| **Parameters**                    | **Details**                                                                                |
| --------------------------------- | ------------------------------------------------------------------------------------------ |
| File Name                         | Specifies the name of the file to which data will be written.                              |
| File Write Method                 | Determines how the data will be written to the file: append, overwrite, or delete.         |
| Output File Type                  | Defines the format of the output file, such as JSON, CSV, or Parquet.                      |
| Add New Line                      | Indicates whether to append a new line after each entry in the output file.                |
| Create Directories                | Automatically creates any required directories that do not exist.                          |
| Generate Filename From Expression | Enables dynamic filename generation based on specified expressions.                        |
| Time Interval in Seconds          | Sets a timer for rewriting the file at specified intervals.                                |
| CSV Comma                         | Specifies the delimiter to be used in CSV files; only the first character will be applied. |
| CSV Header                        | Controls the inclusion or exclusion of column names in the output CSV file.                |
| CSV Columns From Payload          | Determines if column names should be generated based on the incoming payload.              |
| CSV Custom Columns                | Allows the specification of custom column names, overriding those from the payload.        |
| Parquet Capacity                  | Defines the buffer size for records in Parquet files, influencing how data is written.     |

## ImagePreview

Displays an image from the message payload as a preview in the flow. The processor reads image data from a payload field, renders it at a set width, and produces no output.

Configure the following parameters to control which image is shown and how.

| Parameters          | Details                                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Image Name          | The label shown with the image.                                                                                       |
| Image Property Name | The payload field that holds the image data. Default is `value`. Required.                                            |
| Image Width Name    | The display width of the image in pixels. The height scales automatically to keep the aspect ratio. Default is `500`. |

## StdOut

Prints incoming data to the console.

:::hint{type="info"}
**Note**: The output is meant for support logs, not for display on the UI.
:::

