Skip to content

Unix Domain Socket Output

Defines a Unix socket output to write TenXObject instance and template field values.

Configuration

To configure the Unix domain socket output module, Edit these settings.

Below is the default configuration from: unix/config.yaml (* Required Fields).

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' Unix socket output configuration

# Configure a UNIX socket output to write TenXObject instance and template field values.
# To learn more see https://doc.log10x.com/run/output/event/unix

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

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

include: run/modules/output/event/unix

# ============================== UNIX Socket Options ==========================

# Multiple UNIX socket outputs can be defined below
outputUnixSocket:

  # ----------------------------- Object Output ------------------------------

    # 'writeObjects' controls whether to write TenXObject field values to output.
  - writeObjects: false # (❗ REQUIRED)

    # ---------------------------- UNIX Options -----------------------------

    # 'url' sets the target socket address to write TenXObject instance values.
    address: /var/run/socket

    # --------------------------- Encoding Options ----------------------------

    # '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() 

    # 'encodeType' specifies how 'fields' are encoded to output. Possible values: [json,delimited].
    #  To learn more see https://doc.log10x.com/run/output/event/outputStream/#outputstreamencodetype
    encodeType: json      

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

    # 'writeTemplates' controls whether to write new templates for TenXObjects written to
    #  this output. To learn more see https://doc.log10x.com/run/template
  - writeTemplates: false

    # ---------------------------- UNIX Options -----------------------------

    # 'url' sets the target socket address to write new TenXTemplate values.
    address: /var/run/socket

Options

Specify the options below to configure multiple Unix domain socket output:

Name Description
outputUnixSocketAddress Path address for the Unix domain socket
outputUnixSocketConnectTimeout Connection timeout in ms
outputUnixSocketFields List of TenXObject field names to encode
outputUnixSocketFilter A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output
outputUnixSocketWriteObjects If true, encode TenXObjects [outputUnixSocketFields](https://doc.log10x.com/run/output/event/unix/#outputunixsocketfields) to this output
outputUnixSocketWriteTemplates If true, write new TenXTemplates to this output
outputUnixSocketEncodeType The output format in which to encode TenXObject values. Possible values:[json, delimited]
outputUnixSocketEncodedLinePrefix The line prefix prepended to the encoded event if 'outputUnixSocketEncodeType' is 'delimited'
outputUnixSocketEncodeDelimiter The delimiter placed between key and values pairs if 'outputUnixSocketEncodeType' is 'delimited'
outputUnixSocketEncodeGroupDelimiter String delimiter to use when separating individual 10x events inside a group

outputUnixSocketAddress

Path address for the Unix domain socket.

Type Required
File

Specifies a Unix file path (e.g., /tmp/foo) to TenXObject instance/template field values to.

outputUnixSocketConnectTimeout

Connection timeout in ms.

Type Default
Number 5000

Sets the connection timeout in ms for connecting to outputUnixSocketAddress To learn more see connection timeouts.

outputUnixSocketFields

List of TenXObject field names to encode.

Type Default
List []

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

outputUnixSocketFilter

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

Type Default
String ""

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

outputUnixSocketWriteObjects

If true, encode TenXObjects [outputUnixSocketFields](https://doc.log10x.com/run/output/event/unix/#outputunixsocketfields) to this output.

Type Default
String true

Determine whether to write outputUnixSocketFields values of an TenXObject passed to this output. This configuration is typically defined using a JavaScript expression.

To enable/disable the output depending on whether a launch argument, environment variable, or JVM -D option evaluates as truthy, use:

  outputUnixSocketWriteObjects: $=TenXEnv.get("unixSocketAddress")

To learn more see TenXEnv.get.

outputUnixSocketWriteTemplates

If true, write new TenXTemplates to this output.

Type Default
String false

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.

outputUnixSocketEncodeType

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

Type Default
String delimited

Specifies how to encode outputUnixSocketFields 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 outputUnixSocketEncodeDelimiter argument determines the separator to use.

outputUnixSocketEncodedLinePrefix

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

Type Default
String

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

outputUnixSocketEncodeDelimiter

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

Type Default
String

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

outputUnixSocketEncodeGroupDelimiter

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

Type Default
String ""

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


This module is defined in unix/module.yaml.