Type to search.

Move fields

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The move_fields processor moves event fields from one object into another. It can also rearrange fields or add a prefix to fields.

The processor extracts fields from from, then uses fields and exclude as filters to choose which fields to move into the to field.

For example, given the following event:

JSON
{
  "app": {
    "method": "a",
    "elapsed_time": 100,
    "user_id": 100,
    "message": "i'm a message"
  }
}

To move method and elapsed_time into another object, use this configuration:

YAML
processors:
  - move_fields:
      from: "app"
      fields: ["method", "elapsed_time"],
      to: "rpc."

Your final event will be:

JSON
{
  "app": {
    "user_id": 100,
    "message": "i'm a message",
    "rpc": {
      "method": "a",
      "elapsed_time": 100
    }
  }
}

To add a prefix to the whole event:

JSON
{
  "app": { "method": "a"},
  "cost": 100
}

Use this configuration:

YAML
processors:
  - move_fields:
      to: "my_prefix_"

Your final event will be:

JSON
{
  "my_prefix_app": { "method": "a"},
  "my_prefix_cost": 100
}
Name Required Default Description
from no Which field you want extract. This field and any nested fields will be moved into to unless they are filtered out. If empty, indicates event root.
fields no Which fields to extract from from and move to to. An empty list indicates all fields.
ignore_missing no false Ignore "not found" errors when extracting fields.
exclude no A list of fields to exclude and not move.
to yes These fields extract from from destination field prefix the to will base on fields root.