anchor.diff:  <2> Whether the rollover was dry run.
   <3> The result of each condition.
   
  +
  +[[rollover-data-stream-ex]]
  +===== Roll over a data stream
  +
  +[source,console]
  +--------------------------------------------------
  +PUT /_data_stream/my-data-stream <1>
  +{
  +  "timestamp_field": "date"
  +}
  +
  +# Add > 1000 documents to my-data-stream
  +
  +POST /my-data-stream/_rollover <2>
  +{
  +  "conditions" : {
  +  "max_age": "7d",
  +  "max_docs": 1000,
  +  "max_size": "5gb"
  +  }
  +}
  +--------------------------------------------------
  +// TEST[setup:huge_twitter]
  +// TEST[s/# Add > 1000 documents to my-data-stream/POST _reindex?refresh\n{"source":{"index":"twitter"},"dest":{"index":"my-data-stream-000001"}}/]
  +<1> Creates a data stream called `my-data-stream` with one initial backing index
  +named `my-data-stream-000001`.
  +<2> This request creates a new backing index, `my-data-stream-000002`, and adds
  +it as the write index for the `my-data-stream` data stream if the current
  +write index meets at least one of the following conditions:
  ++
  +--
  +* The index was created 7 or more days ago.
  +* The index has an index size of 5GB or greater.
  +* The index contains 1,000 or more documents.
  +--
  +
  +The API returns the following response:
  +
  +[source,console-result]
  +--------------------------------------------------
  +{
  +  "acknowledged": true,
  +  "shards_acknowledged": true,
  +  "old_index": "my-data-stream-000001", <1>
  +  "new_index": "my-data-stream-000002", <2>
  +  "rolled_over": true, <3>
  +  "dry_run": false, <4>
  +  "conditions": { <5>
  +    "[max_age: 7d]": false,
  +    "[max_docs: 1000]": true,
  +    "[max_size: 5gb]": false,
  +  }
  +}
  +--------------------------------------------------
  +
  +<1> The previous write index for the data stream.
  +<2> The new write index for the data stream.
  +<3> Whether the index was rolled over.
  +<4> Whether the rollover was dry run.
  +<5> The result of each condition.
  +
  +////
  +[source,console]
  +-----------------------------------
  +DELETE /_data_stream/my-data-stream
  +-----------------------------------
  +// TEST[continued]
  +////
  +
   [[rollover-index-settings-ex]]
   ===== Specify settings for the target index
   
   The settings, mappings, and aliases for the new index are taken from any
  -matching <<indices-templates,index templates>>. Additionally, you can specify
  -`settings`, `mappings`, and `aliases` in the body of the request, just like the
  -<<indices-create-index,create index>> API. Values specified in the request
  +matching <<indices-templates,index templates>>. If the rollover target is an index
  +alias, you can specify `settings`, `mappings`, and `aliases` in the body of the request
  +just like the <<indices-create-index,create index>> API. Values specified in the request
   override any values set in matching index templates. For example, the following
   `rollover` request overrides the `index.number_of_shards` setting:
   
  
positive.code: 
  `max_size`::
  (Optional, <<byte-units, byte units>>)
  Maximum index size. 
  This is the total size of all primary shards in the index. 
  Replicas are not counted toward the maximum index size.
  
  TIP: To see the current index size, use the <<cat-indices, _cat indices>> API. 
  The `pri.store.size` value shows the combined size of all primary shards. 
  --
  
  include::{docdir}/rest-api/common-parms.asciidoc[tag=mappings]
  
negative.code: 
  include::{docdir}/indices/create-index.asciidoc[tag=index-name-reqs]
  
  *This parameter is not permitted if `rollover-target` is a data stream. In
  that case, the new index name will be in the form `<rollover-target>-000001`
  where the zero-padded number of length 6 is the generation of the data stream.
  
  If `rollover-target` is an alias that is assigned to an index name that ends
  with `-` and a number such as `logs-000001`. In this case, the name of the new
  index follows the same pattern and increments the number. For example,
  `logs-000001` increments to `logs-000002`. This number is zero-padded with a
  length of 6, regardless of the prior index name.
  
  If the existing index for the alias does not match this pattern, this parameter
  is required.
  --
  
  
  