Skip to content

Stdout/err Output

Writes TenXObject instance and template field values to stdout.

Configuration

To configure the Stdout/err output module, Edit these settings.

Below is the default configuration from: stdout/config.yaml.

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' stdout output configuration

# Configure stdout/err streams for writing TenXObject instance and template values.
# To learn more see https://doc.log10x.com/run/output/event/stdout

# Set the 10x pipeline to 'run'
tenx: run

# =============================== Dependencies ================================

include: run/modules/output/event/stdout

# ============================= Stdout Options ================================

# Multiple stdout outputs can be defined below
stdout:

  # ---------------------------10x Encoding Output ----------------------------

    # Encode TenXObjects: https://doc.log10x.com/run/transform/#template-encoding

    # 'target' can be SYSTEM_OUT or SYSTEM_ERR
  - target: SYSTEM_OUT

    # 'filter' sets a JavaScript expression that TenXObjects must evaluate as truthy to write to the output.
    #  To learn more see https://doc.log10x.com/run/output/regulate/#filter-expressions
    filter: isObject                

    # 'fields' defines the fields to write for each TenXObject sent to this output.
    #  To learn more see https://doc.log10x.com/run/output/stream/#outputfields  
    fields: 
      - encode() # https://doc.log10x.com/api/js/#TenXObject+encode

  # ----------------------------- Decode Output -------------------------------

    # Template-decode TenXObjects: https://doc.log10x.com/run/transform/#expand

  - target: SYSTEM_OUT

    filter: isEncoded  # https://doc.log10x.com/api/js/#TenXBaseObject+isEncoded   

    fields: 
      - text           # https://doc.log10x.com/api/js/#TenXBaseObject+text

  # ---------------------------- Template Output ------------------------------

    # Writes TenXTemplate values: https://doc.log10x.com/run/transform/#template

  - target: SYSTEM_OUT

    # 'writeTemplates' controls whether to write new TenXObjects templates to stdout. 
    # To learn more see https://doc.log10x.com/run/output/event/stdout/#stdoutwritetemplates
    writeTemplates: true 

  # ----------------------------- Summary Output ------------------------------

    # Writes aggregated TenXSummaries: https://doc.log10x.com/run/aggregate/

  - target: SYSTEM_OUT

    filter: isSummary   # https://doc.log10x.com/api/js/#TenXBaseObject+isSummary                        

    fields: 
      - $=yield TenXEnv.get("enrichmentFields") # https://doc.log10x.com/run/initialize/#enrichmentFields
      - summaryVolume                           # https://doc.log10x.com/api/js/#TenXSummary+summaryVolume
      - summaryBytes                            # https://doc.log10x.com/api/js/#TenXSummary+summaryBytes
      - summaryTotals                           # https://doc.log10x.com/api/js/#TenXSummary+summaryTotals

Options

Specify the options below to configure multiple Stdout/err output:

Name Description Category
stdoutTarget Target pipe to write to Stdout
stdoutFields List of TenXObject field names to encode Encoding
stdoutFilter A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output Encoding
stdoutWriteObjects If true, encode TenXObjects [stdoutFields](https://doc.log10x.com/run/output/event/stdout/#stdoutfields) to this output Encoding
stdoutWriteTemplates If true, write new TenXTemplates to this output Encoding
stdoutEncodeType The output format in which to encode TenXObject values. Possible values:[json, delimited] Encoding
stdoutEncodedLinePrefix The line prefix prepended to the encoded event if 'stdoutEncodeType' is 'delimited' Encoding
stdoutEncodeDelimiter The delimiter placed between key and values pairs if 'stdoutEncodeType' is 'delimited' Encoding
stdoutEncodeGroupDelimiter String delimiter to use when separating individual 10x events inside a group Encoding
stdoutLog4j2 If true, write using log4j2 appender Advanced

Stdout

stdoutTarget

Target pipe to write to.

Type Required Category
String Stdout

Output device to write to. Possible values: SYSTEM_OUT or SYSTEM_ERR.

Encoding

stdoutFields

List of TenXObject field names to encode.

Type Default Category
List [] Encoding

Specifies a list of TenXObject intrinsic/calculated/extracted field names to extract and write to the output.

stdoutFilter

A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output.

Type Default Category
String "" Encoding

Specifies a JavaScript expression that an TenXObject must evaluate as truthy to write its instance/template field values to this output. For example, 'stdoutFilter: this.timestamp' will only emit timestamped TenXObjects.

stdoutWriteObjects

If true, encode TenXObjects [stdoutFields](https://doc.log10x.com/run/output/event/stdout/#stdoutfields) to this output.

Type Default Category
String true Encoding

Determine whether to write stdoutFields values of an TenXObject passed to this output. This configuration is typically defined using a JavaScript expression. For example, setting 'stdoutWriteObjects' to '$=TenXEnv.get("stdout")' enables/disables the output depending on whether a launch argument, environment variable, or JVM -D option evaluates as truthy.

stdoutWriteTemplates

If true, write new TenXTemplates to this output.

Type Default Category
String false Encoding

Controls whether to write template values of TenXObjects passed to this output. The output will only emit TenXTemplates that the pipeline did not load at startup via the templateFile argument, and will only emit an TenXTemplate once based on its templateHash value.

stdoutEncodeType

The output format in which to encode TenXObject values. Possible values:[json, delimited].

Type Default Category
String delimited Encoding

Specifies how to encode stdoutFields values to this output. Possible values:

  • json: formats names and values for the current TenXObject as: {"field":"str","field2":1, "field3": true}
  • delimited: formats values for the current TenXObject as: "str",1,true The stdoutEncodeDelimiter argument determines the separator to use.

stdoutEncodedLinePrefix

The line prefix prepended to the encoded event if 'stdoutEncodeType' is 'delimited'.

Type Default Category
String ~ Encoding

Sets the char which is prepended to the emitted TenXObject field values when stdoutEncodeType is delimited.

stdoutEncodeDelimiter

The delimiter placed between key and values pairs if 'stdoutEncodeType' is 'delimited'.

Type Default Category
String Encoding

Sets the char delimiter to separate TenXObject field values when stdoutEncodeType is delimited.

stdoutEncodeGroupDelimiter

String delimiter to use when separating individual 10x events inside a group.

Type Default Category
String "" Encoding

Sets the string delimiter used to separate individual 10x events inside a group when encoded to a stream/event output.

Advanced

stdoutLog4j2

If true, write using log4j2 appender.

Type Default Category
Boolean false Advanced

Controls whether to write to file using an OutputStream or a log4j2 appender.


This module is defined in stdout/module.yaml.