---
title: "Java OutputStream Output"
description: "write TenXObject and template values to a Java OutputStream/Writer instance"
source: "https://github.com/log-10x/modules/tree/main/pipelines/run/modules/output/event/outputStream/module.yaml"
icon: "material/language-java"

---
Defines a Java [OutputStream](https://www.baeldung.com/java-outputstream){target="\_blank"} to write [TenXObject](https://doc.log10x.com/api/js/#TenXObject "Provide structured, reflective access to log/trace events read from input(s).") instance and template field values.

OutputStreams provide a simple mechanism for adding custom output destinations
to write TenXObject/Summary/Template values.

For an example of a custom OutputStream implementation see [UnixSocketOutputStream](https://github.com/log-10x/pipeline-extensions/blob/main/edge-extensions/src/main/java/com/log10x/ext/edge/output/unix/UnixSocketOutputStream.java#L19){target="\_blank"}

## :material-wrench-outline: Config Files

To configure the Java OutputStream output module, [:material-cog: Edit](https://doc.log10x.com/config/app/#module-config "Learn how to edit app and module configurations") these files.  

Below is the default configuration from: [outputStream/config.yaml](https://github.dev/log-10x/config/blob/main/pipelines/run/output/event/outputStream/config.yaml "outputStream/config.yaml"){target="\_blank"} (<span class="tenx-tooltip" data-tooltip="The config file below contains required fields to activate this module, marked with &#10071;">** Required Fields*</span>).  
  
<div class="edit-options">
    <a class="md-button tenx-edit-online-button" data-tooltip="Edit online on github.dev" href="https://github.dev/log-10x/config/blob/main/pipelines/run/output/event/outputStream/config.yaml" target="_blank" rel="noopener noreferrer">
        <span class="twemoji" style="margin-right: 0.3rem;">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path>
            </svg>
        </span> Edit Online
    </a>
    <button class="md-button tenx-config.yaml0-edit-button" data-tooltip="Edit configuration file" data-dialog-id="config-yaml0-dialog">
        <span style="margin-right: 0.3rem;">
            <span class="twemoji">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                    <path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"></path>
                </svg>
            </span>
        </span>Edit Locally
    </button>
</div>

<dialog id="config-yaml0-dialog" class="md-dialog md-dialog--editor">
    <div class="editor-dialog-wrapper">
        <div class="editor-dialog-header">
            <span class="editor-dialog-title">Edit config.yaml Locally</span>
            <div class="editor-header-actions">
                <button class="editor-toolbar-btn yaml-editor-locations" data-tooltip="Save">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5 20h14v-2H5v2m14-9h-4V3H9v8H5l7 7 7-7Z"></path></svg>
                </button>
                <button class="editor-toolbar-btn yaml-editor-reset" data-tooltip="Reset to default">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"></path></svg>
                </button>
                <button class="editor-toolbar-btn yaml-editor-copy" data-tooltip="Copy to clipboard">
                    <svg class="icon-copy" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"></path></svg>
                    <svg class="icon-check" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="display:none;"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg>
                </button>
                <span class="header-divider"></span>
                <button class="editor-toolbar-btn yaml-editor-fullscreen" data-tooltip="Fullscreen">
                    <svg class="icon-maximize" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"></path></svg>
                    <svg class="icon-minimize" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="display:none;"><path fill="currentColor" d="M5,16H8V19H10V14H5V16M14,14V19H16V16H19V14H14M16,5V8H19V10H14V5H16M10,5V10H5V8H8V5H10Z"></path></svg>
                </button>
                <span class="header-divider"></span>
                <button class="editor-toolbar-btn editor-dialog-close" onclick="closeDialog('config-yaml0-dialog')" data-tooltip="Close">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg>
                </button>
            </div>
        </div>
        <div class="editor-dialog-content">
            <div class="yaml-editor-container"></div>
        </div>
        <div class="yaml-editor-statusbar">
            <span class="yaml-editor-status"></span>
        </div>
    </div>
    <!-- Locations Popup -->
    <div class="locations-popup" style="display: none;">
        <div class="locations-popup-content">
            <div class="locations-popup-header">
                <span class="locations-header-label">Download and save to:</span>
                <button class="locations-popup-close" aria-label="Close">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
                        <path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path>
                    </svg>
                </button>
            </div>
            <ul class="locations-list">
                <li>
                    <span class="location-label">Linux / Docker / macOS
                        <span class="help-icon" data-tooltip="Default system location. The engine automatically reads configs from here at startup. Best for production deployments.">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M11 18h2v-2h-2v2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14a4 4 0 0 0-4 4h2a2 2 0 0 1 2-2 2 2 0 0 1 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4Z"/></svg>
                        </span>
                    </span>
                    <div class="location-path-row">
                        <code class="default-path location-path" data-tooltip=""
                            data-copy-osx="/etc/log10x/config/run/output/event/outputStream/config.yaml"
                            data-copy-nix="/etc/log10x/config/run/output/event/outputStream/config.yaml"
                            data-copy-win="C:\log10x\configs/run/output/event/outputStream/config.yaml"></code>
                        <button class="copy-btn" data-tooltip="Copy path">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">
                                <path fill="currentColor" d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"></path>
                            </svg>
                        </button>
                    </div>
                </li>
                <li>
                    <span class="location-label">Custom directory
                        <span class="help-icon" data-tooltip="Set TENX_CONFIG environment variable to point to a custom config directory. Useful when you want configs in a non-standard location.">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M11 18h2v-2h-2v2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14a4 4 0 0 0-4 4h2a2 2 0 0 1 2-2 2 2 0 0 1 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4Z"/></svg>
                        </span>
                    </span>
                    <div class="location-path-row">
                        <code class="location-path" data-tooltip="$TENX_CONFIG/run/output/event/outputStream/config.yaml">$TENX_CONFIG/run/output/event/outputStream/config.yaml</code>
                        <button class="copy-btn" data-tooltip="Copy path">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">
                                <path fill="currentColor" d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"></path>
                            </svg>
                        </button>
                    </div>
                </li>
                <li>
                    <span class="location-label">Within cloned repo
                        <span class="help-icon" data-tooltip="First run: git clone github.com/log-10x/config. Then save the file to this path within the cloned folder. Use for version control.">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12"><path fill="currentColor" d="M11 18h2v-2h-2v2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14a4 4 0 0 0-4 4h2a2 2 0 0 1 2-2 2 2 0 0 1 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4Z"/></svg>
                        </span>
                    </span>
                    <div class="location-path-row">
                        <code class="location-path" data-tooltip="./pipelines/run/output/event/outputStream/config.yaml">./pipelines/run/output/event/outputStream/config.yaml</code>
                        <button class="copy-btn" data-tooltip="Copy path">
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">
                                <path fill="currentColor" d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"></path>
                            </svg>
                        </button>
                    </div>
                </li>
            </ul>
            <div class="locations-popup-footer">
                <button class="locations-download-btn" title="Download config file">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">
                        <path fill="currentColor" d="M5 20h14v-2H5v2m14-9h-4V3H9v8H5l7 7 7-7Z"></path>
                    </svg>
                    <span>Download</span>
                </button>
            </div>
        </div>
    </div>
</dialog>

<template class="tenx-config-schema" data-encoding="base64">ewogICJ0eXBlIiA6ICJvYmplY3QiLAogICJwcm9wZXJ0aWVzIiA6IHsKICAgICJpbmNsdWRlIiA6IHsKICAgICAgInR5cGUiIDogInN0cmluZyIKICAgIH0sCiAgICAidGVueCIgOiB7CiAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICB9LAogICAgIm91dHB1dFN0cmVhbSIgOiB7CiAgICAgICJ0eXBlIiA6ICJhcnJheSIsCiAgICAgICJpdGVtcyIgOiB7CiAgICAgICAgInR5cGUiIDogIm9iamVjdCIsCiAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiA6IGZhbHNlLAogICAgICAgICJwcm9wZXJ0aWVzIiA6IHsKICAgICAgICAgICJjbGFzcyIgOiB7CiAgICAgICAgICAgICJ0eXBlIiA6IFsKICAgICAgICAgICAgICAic3RyaW5nIiwKICAgICAgICAgICAgICAibnVsbCIKICAgICAgICAgICAgXSwKICAgICAgICAgICAgIm1hcmtkb3duRGVzY3JpcHRpb24iIDogIkZ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biBncm91cCBpbnN0YW5jZS4gIFRoaXMgYXJndW1lbnQgYWxsb3dzIGZvciBwcm92aWRpbmcgc3RyZWFtLXNwZWNpZmljIGNvbnRleHQgYW5kIGRlZmF1bHQgdmFsdWVzIHN1Y2ggYXMgYSBob3N0IGFkZHJlc3MsIHBvcnQsIGV0Yy4iLAogICAgICAgICAgICAiaXRlbXMiIDogewogICAgICAgICAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICAiZmllbGRzIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJhcnJheSIsCiAgICAgICAgICAgICAgInN0cmluZyIsCiAgICAgICAgICAgICAgIm51bGwiCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJtYXJrZG93bkRlc2NyaXB0aW9uIiA6ICJMaXN0IG9mIFRlblhPYmplY3QgZmllbGQgbmFtZXMgdG8gZW5jb2RlXG5cblNwZWNpZmllcyBhIGxpc3Qgb2YgVGVuWE9iamVjdCBpbnRyaW5zaWMvY2FsY3VsYXRlZC9leHRyYWN0ZWQgZmllbGQgbmFtZXMgdG8gZXh0cmFjdCBhbmQgd3JpdGUgdG8gdGhlIG91dHB1dC4iLAogICAgICAgICAgICAiaXRlbXMiIDogewogICAgICAgICAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICAiZ3JvdXBLZXlzIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJhcnJheSIsCiAgICAgICAgICAgICAgInN0cmluZyIsCiAgICAgICAgICAgICAgIm51bGwiCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJtYXJrZG93bkRlc2NyaXB0aW9uIiA6ICJWYWx1ZXMgdG8gYXNzaWduIGFuICdvdXRwdXRTdHJlYW0nIHRvIGEgdGFyZ2V0IG91dHB1dCBpbnN0YW5jZVxuXG5TcG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gICB9LAogICAgICAgICAgImVuY29kZWRMaW5lUHJlZml4IiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJzdHJpbmciLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiVGhlIGxpbmUgcHJlZml4IHByZXBlbmRlZCB0byB0aGUgZW5jb2RlZCBldmVudCBpZiAnb3V0cHV0U3RyZWFtRW5jb2RlVHlwZScgaXMgJ2RlbGltaXRlZCdcblxuU2V0cyB0aGUgY2hhciB3aGljaCBpcyBwcmVwZW5kZWQgdG8gdGhlIGVtaXR0ZWQgVGVuWE9iamVjdCBmaWVsZCB2YWx1ZXMgd2hlbiBbb3V0cHV0U3RyZWFtRW5jb2RlVHlwZV0oaHR0cHM6Ly9kb2MubG9nMTB4LmNvbS9ydW4vb3V0cHV0L2V2ZW50L291dHB1dFN0cmVhbS8jb3V0cHV0c3RyZWFtZW5jb2RldHlwZSkgaXMgYGRlbGltaXRlZGAuIChEZWZhdWx0OiApIiwKICAgICAgICAgICAgImRlZmF1bHQiIDogIiIKICAgICAgICAgIH0sCiAgICAgICAgICAiZW5jb2RlRGVsaW1pdGVyIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJzdHJpbmciLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiVGhlIGRlbGltaXRlciBwbGFjZWQgYmV0d2VlbiBrZXkgYW5kIHZhbHVlcyBwYWlycyBpZiAnb3V0cHV0U3RyZWFtRW5jb2RlVHlwZScgaXMgJ2RlbGltaXRlZCdcblxuU2V0cyB0aGUgY2hhciBkZWxpbWl0ZXIgdG8gc2VwYXJhdGUgVGVuWE9iamVjdCBmaWVsZCB2YWx1ZXMgd2hlbiBbb3V0cHV0U3RyZWFtRW5jb2RlVHlwZV0oaHR0cHM6Ly9kb2MubG9nMTB4LmNvbS9ydW4vb3V0cHV0L2V2ZW50L291dHB1dFN0cmVhbS8jb3V0cHV0c3RyZWFtZW5jb2RldHlwZSkgaXMgYGRlbGltaXRlZGAuIChEZWZhdWx0OiBcIiBcIikiLAogICAgICAgICAgICAiZGVmYXVsdCIgOiAiXCIgXCIiCiAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAicmVxdWlyZWQiIDogWwogICAgICAgICAgImNsYXNzIgogICAgICAgIF0KICAgICAgfQogICAgfQogIH0sCiAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiA6IHRydWUKfQ==</template>

```yaml
# 🔟❎ 'run' output stream configuration

# Configure a Java OutputStream to write TenXObject field and templates values.
# To learn more see https://doc.log10x.com/run/output/event/outputStream/

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

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

include: run/modules/output/event/outputStream

# ============================ OutputStream Options ===========================

# Multiple OutputStream file outputs can be defined below
outputStream:

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

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

    # ------------------------- OutputStream Options -------------------------

    # 'class' specifies the class derived from java.io.OutputStream
    #  that is instantiated, written to and closed by the 10x host JVM
    #  In this example, values are written to a Unix domain socket
    class: com.log10x.ext.edge.output.unix.UnixSocketOutputStream

    # 'args' provides an optional mechanism to pass an Object[] value
    #  to the constructor of 'class' that contains implementation-specific
    #  configuration values. In this example, we calculate and set the
    #  file name used by the Unix domain socket to write which TenXObject instance/template values.
    args:
      - address
      - '$=path("<user.home>/tenx.socket")' 

    # 'groupKeys' provides an optional mechanism for grouping instances of
    #  'class' according to a unique set of values. Grouping allows multiple
    #  outputs such as this output and the template output below it to
    #  share a single instance of 'class' which is effective when writing
    #  to OutputStream, which holds a mutually exclusive resource. In this
    #  example, outputs are grouped by the address of the client Unix domain socket.
    groupKeys:
      - '$=path("<user.home>/tenx.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/receive/#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: delimited 

    # 'encodeDelimiter' sets the char delimiter used to separate TenXObject
    #  field values when 'encodeType' is set to: 'delimited'     
    encodeDelimiter: ',' 


  # ---------------------------- Template Output ----------------------------
    
    # 'writeTemplates' controls whether to write template values for TenXObjects passed to
    #  to file. Only new templates are written. 
  - writeTemplates: true

    # ------------------------- OutputStream Options -------------------------

    # The file output below writes the template values of TenXObjects 
    # passed to this file location. To learn more about TenXTemplates, see:
    # https://doc.log10x.com/run/template
    
    # For descriptions of 'class', 'args', and 'groupKeys', see the 
    # object output stream above. 
    class: com.log10x.ext.edge.output.unix.UnixSocketOutputStream

    args:
      - address
      - '$=path("<user.home>/tenx.socket")' 

    groupKeys:
      - '$=path("<user.home>/tenx.socket")' 
```

## :material-menu: Options

Specify the options below to [configure](/config "configure") multiple Java OutputStream output:

|Name|Description|Category|
|---|---|---|
|[outputStreamClass](#outputstreamclass "fully2 qualified java.io.OutputStream/Writer sub-class name")|Fully2 qualified java.io.OutputStream/Writer sub-class name|General|
|[outputStreamArgs](#outputstreamargs "arguments to pass to the constructor of 'outputStreamClass'")|Arguments to pass to the constructor of 'outputStreamClass'|General|
|[outputStreamFilter](#outputstreamfilter "a JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output")|A JavaScript expression an TenXObject must evaluate as 'truthy' against to be written to this output|General|
|[outputStreamFields](#outputstreamfields "list of TenXObject field names to encode")|List of TenXObject field names to encode|Encode|
|[outputStreamWriteObjects](#outputstreamwriteobjects "if true, TenXObject field values specified by [outputStreamFields](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields) are encoded to this output")|If true, TenXObject field values specified by \[outputStreamFields\](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields) are encoded to this output|Encode|
|[outputStreamWriteTemplates](#outputstreamwritetemplates "if true, write new TenXTemplates to this output")|If true, write new TenXTemplates to this output|Encode|
|[outputStreamEncodeType](#outputstreamencodetype "the output format in which to encode TenXObject values. Possible values:[json, delimited]")|The output format in which to encode TenXObject values. Possible values:\[json, delimited\]|Encode|
|[outputStreamEncodedLinePrefix](#outputstreamencodedlineprefix "the line prefix prepended to the encoded event if 'outputStreamEncodeType' is 'delimited'")|The line prefix prepended to the encoded event if 'outputStreamEncodeType' is 'delimited'|Encode|
|[outputStreamEncodeDelimiter](#outputstreamencodedelimiter "the delimiter placed between key and values pairs if 'outputStreamEncodeType' is 'delimited'")|The delimiter placed between key and values pairs if 'outputStreamEncodeType' is 'delimited'|Encode|
|[outputStreamGroupKeys](#outputstreamgroupkeys "values to assign an 'outputStream' to a target output instance")|Values to assign an 'outputStream' to a target output instance|Advanced|

### General

#### :material-menu-right-outline:**`outputStreamClass`**

Fully2 qualified java.io.OutputStream/Writer sub-class name.

|Type|Required|Category|
|---|---|---|
|String|✔|General|

specifies a fully qualified [OutputStream](https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html){target="\_blank"} or [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html){target="\_blank"}
sub-class to instantiate. The specified [outputStreamFields](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields "list of TenXObject field names to encode") of each encoded TenXObjects will be written
to the stream with a matching call to its [flush](https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html#flush--){target="\_blank"} method
after each instance.

The class must implement a parameterless constructor or one with the following signature:

```java
/**
* @param args
*   The values of the 'outputStream' option group specified
* 	for this OutputStream/Writer instance provided as a map(<argName>=<argValue>...).
*   This allows the stream to read configuration values provided via config files/command line arguments.
*
* @param evaluatorBean
*   An evaluator bean to enable this stream to interact with the 10x Engine
*/
public MyOutputStream(Map<String, Object> args, com.log10x.api.bean.EvaluatorBean evaluatorBean){...}
```


#### :material-menu-right-outline:**`outputStreamArgs`**

Arguments to pass to the constructor of 'outputStreamClass'.

|Type|Default|Category|
|---|---|---|
|List|\[\]|General|

Value pairs to insert to the OutputStream/Writer constructor 'args' Map.
This argument adds configuration values to the map passed to Stream/Writer ctor
in addition to those specified by its matching 'outputStream' option group instance.

This argument allows for providing stream-specific context and default values such as a host address, port, etc.


#### :material-menu-right-outline:**`outputStreamFilter`**

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

|Type|Default|Category|
|---|---|---|
|String|""|General|

Specifies a JavaScript expression that an TenXObject must evaluate as truthy to write its
instance/template field values to this output.

For example, to only emit [timestamped](https://doc.log10x.com/api/js/#TenXBaseObject+timestamped "Return true if length of timestamp is greater than 0") TenXObjects, specify:

```yaml
outputStreamFilter: this.timestamped
```


### Encode

#### :material-menu-right-outline:**`outputStreamFields`**

List of TenXObject field names to encode.

|Type|Default|Category|
|---|---|---|
|List|\[\]|Encode|

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


#### :material-menu-right-outline:**`outputStreamWriteObjects`**

If true, TenXObject field values specified by \[outputStreamFields\](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields) are encoded to this output.

|Type|Default|Category|
|---|---|---|
|String|true|Encode|

Determine whether to write [outputStreamFields](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields "list of TenXObject field names to encode") 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:

```yaml
  outputStreamWriteObjects: $=TenXEnv.get("myOutputStreamClass")
```

To learn more see [TenXEnv.get](https://doc.log10x.com/api/js/#TenXEnv.get).


#### :material-menu-right-outline:**`outputStreamWriteTemplates`**

If true, write new TenXTemplates to this output.

|Type|Default|Category|
|---|---|---|
|String|false|Encode|

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](https://doc.log10x.com/run/template/#templatefiles "input files or glob patterns containing JSON-encoded TenXTemplates") argument,
and will only emit an TenXTemplate once based on its [templateHash](https://doc.log10x.com/api/js/#TenXBaseObject+templateHash "An alphanumeric encoded value of a 64bit hash of the current object's template field.") value.


#### :material-menu-right-outline:**`outputStreamEncodeType`**

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

|Type|Default|Category|
|---|---|---|
|String|delimited|Encode|

Specifies how to encode [outputStreamFields](https://doc.log10x.com/run/output/event/outputStream/#outputstreamfields "list of TenXObject field names to encode") 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 [outputStreamEncodeDelimiter](https://doc.log10x.com/run/output/event/outputStream/#outputstreamencodedelimiter "the delimiter placed between key and values pairs if 'outputStreamEncodeType' is 'delimited'") argument determines the separator to use.


#### :material-menu-right-outline:**`outputStreamEncodedLinePrefix`**

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

|Type|Default|Category|
|---|---|---|
|String||Encode|

Sets the char which is prepended to the emitted TenXObject field values when [outputStreamEncodeType](https://doc.log10x.com/run/output/event/outputStream/#outputstreamencodetype "the output format in which to encode TenXObject values. Possible values:[json, delimited]") is `delimited`.


#### :material-menu-right-outline:**`outputStreamEncodeDelimiter`**

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

|Type|Default|Category|
|---|---|---|
|String|" "|Encode|

Sets the char delimiter to separate TenXObject field values when [outputStreamEncodeType](https://doc.log10x.com/run/output/event/outputStream/#outputstreamencodetype "the output format in which to encode TenXObject values. Possible values:[json, delimited]") is `delimited`.


### Advanced

#### :material-menu-right-outline:**`outputStreamGroupKeys`**

Values to assign an 'outputStream' to a target output instance.

|Type|Default|Category|
|---|---|---|
|List|\[\]|Advanced|

Specifies a list of values by which instances of the 'outputStream' option group
are assigned to specific instances of 'outputStreamClass' to enable
multiple outputs to use a single synchronized OutputStream instance.


<br/>:material-github: This module is defined in [outputStream/module.yaml](https://github.com/log-10x/modules/tree/main/pipelines/run/modules/output/event/outputStream/module.yaml "outputStream/module.yaml"){target="\_blank"}.

