Type to search.

Enabling and disabling advanced indexing features for Fleet-managed data streams

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.

Fleet provides support for several advanced features around its data streams, including:

These features can be enabled and disabled for Fleet-managed data streams by using the index template API and a few key settings. In versions 8.17.0 and later, synthetic _source is available only for certain Elastic subscription levels.

Note

If you are already making use of @custom component templates for ingest or retention customization (for example, as shown in Customize data retention policies for integrations), exercise care to ensure you don’t overwrite your customizations when making these requests.

We recommended using Kibana Dev Tools to run the following requests. Replace <NAME> with the name of a given integration data stream. For example specifying metrics-nginx.stubstatus results in making a PUT request to _component_template/metrics-nginx.stubstatus@custom. Use the index management interface to explore what integration data streams are available to you.

Once you’ve executed a given request below, you also need to execute a data stream rollover to ensure any incoming data is ingested with your new settings immediately. For example:

Shell
POST metrics-nginx.stubstatus-default/_rollover

Refer to the following steps to enable or disable advanced data stream features:

Note

TSDS uses synthetic _source, so if you want to trial both features you need to enable only TSDS.

Due to restrictions in the Elasticsearch API, TSDS must be enabled at the index template level. So, you’ll need to make some sequential requests to enable or disable TSDS.

  1. Send a GET request to retrieve the index template:

    JSON
    GET _index_template/<NAME>
    
  2. Use the JSON payload returned from the GET request to populate a PUT request, for example:

    JSON
    PUT _index_template/<NAME>
    {
      # You can copy & paste this directly from the GET request above
      "index_patterns": [
        "<index pattern from GET request>"
      ],
    
      # Make sure this is added
      "template": {
        "settings": {
          "index": {
            "mode": "time_series"
          }
        }
      },
    
      # You can copy & paste this directly from the GET request above
      "composed_of": [
        "<NAME>@package",
        "<NAME>@custom",
        ".fleet_globals-1",
        ".fleet_agent_id_verification-1"
      ],
    
      # You can copy & paste this directly from the GET request above
      "priority": 200,
    
      # Make sure this is added
      "data_stream": {
        "allow_custom_routing": false
      }
    }
    

To disable TSDS, follow the same procedure as to enable TSDS, but specify null for index.mode instead of time_series. Follow the steps below or you can copy the NGINX example.

  1. Send a GET request to retrieve the index template:

    JSON
    GET _index_template/<NAME>
    
  2. Use the JSON payload returned from the GET request to populate a PUT request, for example:

    JSON
    PUT _index_template/<NAME>
    {
      # You can copy/paste this directly from the GET request above
      "index_patterns": [
        "<index pattern from GET request>"
      ],
    
      # Make sure this is added
      "template": {
        "settings": {
          "index": {
            "mode": null
          }
        }
      },
    
      # You can copy/paste this directly from the GET request above
      "composed_of": [
        "<NAME>@package",
        "<NAME>@custom",
        ".fleet_globals-1",
        ".fleet_agent_id_verification-1"
      ],
    
      # You can copy/paste this directly from the GET request above
      "priority": 200,
    
      # Make sure this is added
      "data_stream": {
        "allow_custom_routing": false
      }
    }
    

    For example, the following payload disables TSDS on nginx.stubstatus:

    JSON
    {
      "index_patterns": [
          "metrics-nginx.stubstatus-*"
      ],
    
      "template": {
        "settings": {
          "index": {
            "mode": null
          }
        }
      },
    
      "composed_of": [
        "metrics-nginx.stubstatus@package",
        "metrics-nginx.stubstatus@custom",
        ".fleet_globals-1",
        ".fleet_agent_id_verification-1"
      ],
    
      "priority": 200,
    
      "data_stream": {
        "allow_custom_routing": false
      }
    }
    
JSON
PUT _component_template/<NAME>@custom
{
  "settings": {
    "index": {
      "mapping": {
        "source": {
          "mode": "synthetic"
        }
      }
    }
  }
}
JSON
PUT _component_template/<NAME>@custom
{
  "settings": {
    "index": {
      "mapping": {
        "source": {"mode": "stored"}
      }
    }
  }
}