Skip to content

Output

Output integrations provide an extensible mechanisms writing TenXObject instance and template values to event and time-series destinations using industry standard Java frameworks.

To specify .jar files to dynamically load into the host JVM see the jarfiles argument.

OutputStream

The I/O Streams integration enables outputs to write TenXObject instance values to arbitrary destinations via custom OutputStream and Writer classes.

Config example: process/stream.yaml.

Code example: ProcOutputStream.java.

Log4j2

The Log4j2 integration enables appender outputs to emit TenXObject instance values to an extensible selection of local and remote event outputs.

The 10x Engine integrates with log4j2 framework because of its wide ecosystem, high level of configurability and performance. TenXObjects implement the Message interface, making them 1st class citizens within the log4j2 ecosystem.

The 10x Engine provides custom log4j2 plugins that enable access to the 10x JavaScript API from within log4j2 configuration files, allowing dynamic field extraction, filtering, and formatting of TenXObjects during output.

The eval lookup plugin evaluates 10x JavaScript expressions against the current TenXObject being logged.

Plugin Name: eval

Usage in log4j2.yaml:

patternLayout:
  pattern: "%msg ${eval:this.get('level')} ${eval:this.get('source')}%n"

This allows dynamic field extraction from TenXObjects during log output formatting.

Source: EvaluatorLookup.java

The tenxFilter plugin filters log events based on 10x JavaScript expressions evaluated against the target TenXObject.

Plugin Name: tenxFilter

Usage in log4j2.yaml:

appenders:
  rollingFile:
    - name: filteredAppender
      tenxFilter:
        expression: "this.get('level') == 'ERROR'"
        onMatch: ACCEPT
        onMismatch: DENY

Source: ExpressionFilter.java

The tenxFields plugin provides programmatic access to TenXObject field values via a function interface. It returns a map of field name/value pairs.

Plugin Name: tenxFields

Attributes:

Attribute Description
fieldNames Comma-separated list of field names to extract (e.g., "text,vars,price")

Source: FieldValuesAccessor.java

The tag plugin accesses the TenXObject's source tag value.

Plugin Name: tag

Attributes:

Attribute Description
tagField Optional fallback field name if the object is not tagged

The tenxLayout plugin serializes TenXObjects and template values to core/3rd-party appenders with configurable field selection and filtering.

Plugin Name: tenxLayout

Attributes:

Attribute Description
encodedFields Fields to include in output (from outputFileFields)
filter 10x JavaScript expression to filter objects (from outputFileFilter)

Example usage in file output log4j2.yaml:

appenders:
  file:
    - name: $loggerName
      tenxLayout:
        encodedFields: null
        filter: null
      fileName: $outputFilePath
      createOnDemand: true

See File Output for configuration details.

Source: EncodeFieldsLayout.java

Config example: forward/log4j2.yaml

Micrometer

The Micrometer integration enables time-series outputs to publish aggregated TenXSummary instance values to an extensible array of time-series DBs (e.g., Datadog, Prometheus).

To support additional output destinations, define custom registries.

Config example: datadog/stream.yaml.

Code example: DataDogMetricRegistryFactory.java.