---
title: "Object Initializer"
description: "Enrich TenXObjects with additional context"
source: "https://github.com/log-10x/modules/tree/main/pipelines/run/modules/initialize/module.yaml"
icon: "material/function-variant"

---
Enrich TenXObjects with calculated fields for [aggregation](https://doc.log10x.com/run/aggregate/ "Aggregate and summarize TenXObjects to publish as metrics") and [receiving](https://doc.log10x.com/run/output/receive/ "Filter and sample TenXObjects based on per-node budget sampling or a declarative field-set mute file") logic.

## :octicons-package-24: Modules


<div class="grid cards" markdown>

-   :material-select-group:{ .lg .middle } __Group Initializer__

    ---

    Combine multi-line events into TenXObject group instances.

    [:octicons-arrow-right-24: More info](/run/initialize/group)

-   :material-information-outline:{ .lg .middle } __Level Classifier__

    ---

    Classify TenXObjects with a severity level.

    [:octicons-arrow-right-24: More info](/run/initialize/level)

-   :material-origin:{ .lg .middle } __Symbol Message Calculator__

    ---

    Enrich TenXObjects with logical message symbol sequence and origin values.

    [:octicons-arrow-right-24: More info](/run/initialize/message)

-   :material-web:{ .lg .middle } __HTTP Status Code Extractor__

    ---

    Enrich TenXObjects with an extracted HTTP status code.

    [:octicons-arrow-right-24: More info](/run/initialize/httpCode)

-   :material-table-eye:{ .lg .middle } __File Lookup__

    ---

    Enrich TenXObjects with lookup table values.

    [:octicons-arrow-right-24: More info](/run/initialize/lookup)

-   :material-globe-model:{ .lg .middle } __GeoIP Lookup__

    ---

    Geo-reference TenXObjects via their ipAddress value.

    [:octicons-arrow-right-24: More info](/run/initialize/geoIP)

-   :material-kubernetes:{ .lg .middle } __K8s Context Extractor__

    ---

    Enrich TenXObjects with k8s pod and container information.

    [:octicons-arrow-right-24: More info](/run/initialize/k8s)

</div>
## :material-menu: Options

Specify the options below to [configure](/config "configure") the Object initializer:

|Name|Description|
|---|---|
|[inputField](#inputfield "fields whose value to search for symbol values")|Fields whose value to search for symbol values|
|[enrichmentFields](#enrichmentfields "list of field to enrich TenXObjects with")|List of field to enrich TenXObjects with|

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

Fields whose value to search for symbol values.

|Type|Default|
|---|---|
|List|\[log, message, body, text\]|

specifies the names of the TenXObject fields  to search for a for log event message/body in order of lookup priority.

For example, for the following event:

```json
{"stream":"stdout","log":"Accounting service started","docker":{"container_id":"d47021a9963834cf89f32446c1de57e332b9c8391dc9faf42d47f1f7df8411bb"},"kubernetes":{"container_name":"accountingservice","namespace_name":"default","pod_name":"otel-accountingservice-76d9cfd496-hshv6","container_image":"ghcr.io/open-telemetry/demo:1.11.1-accountingservice","container_image_id":"ghcr.io/open-telemetry/demo@sha256:f09dfbd4adf590fcf94070cb832583c1e9572edd558b1c5761429a14d7bf4d9e","pod_id":"b41b9602-d4af-4ffd-a8e5-424541d91388","pod_ip":"192.168.12.183","host":"ip-192-168-27-8.ec2.internal","labels":{"app.kubernetes.io/component":"accountingservice","app.kubernetes.io/instance":"otel","app.kubernetes.io/name":"otel-accountingservice","opentelemetry.io/name":"otel-accountingservice","pod-template-hash":"76d9cfd496"}},"tenx_tag":"kubernetes.var.log.containers.otel-accountingservice-76d9cfd496-hshv6_default_accountingservice-d47021a9963834cf89f32446c1de57e332b9c8391dc9faf42d47f1f7df8411bb.log"}
```

if this value is empty, the [symbolMessageField](https://doc.log10x.com/run/initialize/#symbolmessagefield) field is computed using the entirety of the event's content as:

```
demo_app_kubernetes_io_instance_app_kubernetes_io_name
```

In contrast, if this value is set to `log`, the [symbolMessageField](https://doc.log10x.com/run/initialize/#symbolmessagefield)
is formatted solely from the value of that field, returning:

```
Accounting_service_started
```


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

List of field to enrich TenXObjects with.

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

Sets the default field names used to extract values for [aggregating](https://doc.log10x.com/run/aggregate/ "Aggregate and summarize TenXObjects to publish as metrics") TenXObjects.
Initializer modules automatically add their target fields to this setting.

Each initializer module appends its assigned field names to the global `enrichmentFields`.

Aggregators can use these values to group TenXObjects automatically, without needing explicit specification in their [aggregatorFields](https://doc.log10x.com/run/aggregate/#aggregatorfields "list of field names by which to aggregate TenXObjects").

In the example below an aggregator's fields are set to this value. The yield macro delays evaluation until all config files are loaded.

If no value has been set for this option, the aggregator defaults to grouping instances via a calculated 'sequence' field which captures their [symbol identity](https://doc.log10x.com/run/transform/#metric-name).

```yaml
aggregator:
  - name: myAggregator
    # 'fields' define intrinsic, extracted, or calculated fields whose combined values
    # identify a unique row in the aggregator's in-memory table for each object.
    # Uses enrichment fields from initializer modules by default.
    fields:
      - $=yield TenXEnv.get("enrichmentFields")
```


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

