setup:
  - skip:
      version: " - 7.99.99"
      reason: "telemetry for flattened fields was added in 8.0"

---
"Usage stats for flattened fields":
  - do:
      xpack.usage: {}

  - match: { flattened.available: true }
  - match: { flattened.enabled: true }
  - match: { flattened.field_count: 0 }

  - do:
      indices.create:
        index: test-index1
        body:
          mappings:
            properties:
              flattened_1:
                type: flattened

  - do:
      indices.create:
        index: test-index2
        body:
          mappings:
            properties:
              flattened_2:
                type: flattened
              flattened_3:
                type: flattened
                ignore_above: 10

  - do:
      xpack.usage: {}

  - match: { flattened.available: true }
  - match: { flattened.enabled: true }
  - match: { flattened.field_count: 3 }

setup:
  - skip:
      version: " - 7.5.99"
      reason: "telemetry for flattened fields was added in 7.6.0"

---
"Usage stats for flattened fields":
  - do:
      xpack.usage: {}

  - match: { flattened.available: true }
  - match: { flattened.enabled: true }
  - match: { flattened.field_count: 0 }

  - do:
      indices.create:
        index: test-index1
        body:
          mappings:
            properties:
              flattened_1:
                type: flattened

  - do:
      indices.create:
        index: test-index2
        body:
          mappings:
            properties:
              flattened_2:
                type: flattened
              flattened_3:
                type: flattened
                ignore_above: 10

  - do:
      xpack.usage: {}

  - match: { flattened.available: true }
  - match: { flattened.enabled: true }
  - match: { flattened.field_count: 3 }

Adjust the skip version in flattened field telemetry tests.
Adjust the skip version in flattened field telemetry tests.

It can be lowered to 7.5.99 now that the functionality was backported in #48972.
