{
  "template": {
    "settings": {
      "index": {
        "number_of_shards": "16",
        "auto_expand_replicas": "0-1",
        "refresh_interval": "10s",
        "hidden": true
      }
    },
    "mappings": {
      /*
       Enable source for now because ip_range is not supported by synthetic source.
       And we currently want to use the reindex API for experiments with storage costs.
      */
      "_source": {
        "enabled": true
      },
      "_meta": {
        "index-template-version": ${xpack.profiling.template.version},
        "index-version": ${xpack.profiling.index.symbols.version},
        "managed": true
      },
      "dynamic": false,
      "properties": {
        "ecs.version": {
          "type": "keyword",
          "index": true,
          "doc_values": false,
          "store": false
        },
        /* name of the function */
        "Symbol.function.name": {
          "type": "keyword",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* file path */
        "Symbol.file.name": {
          "type": "keyword",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* (for inlined functions) file path where inline function was called */
        "Symbol.call.file.name": {
          "type": "keyword",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* (for inlined functions) line where inline function was called */
        "Symbol.call.line": {
          "type": "integer",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* function start line (only available from DWARF). Currently unused. */
        "Symbol.function.line": {
          "type": "integer",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* inline depth */
        "Symbol.depth": {
          "type": "integer",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /*
         To find the line number for a given address: find the first offset in Symbol.linetable.offsets such that offset <= base+address,
         then read corresponding line number (at the same index) in Symbol.linetable.lines.

         Linetable: base for offsets (64bit PC range base)
        */
        "Symbol.linetable.base": {
          "type": "unsigned_long",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* Linetable: length of range (PC range is [base, base+length)) */
        "Symbol.linetable.length": {
          "type": "unsigned_long",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* Linetable: concatenated offsets (each value is ULEB128encoded) */
        "Symbol.linetable.offsets": {
          "type": "keyword",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* Linetable: concatenated lines (each value is ULEB128 encoded) */
        "Symbol.linetable.lines": {
          "type": "keyword",
          "index": false,
          "doc_values": false,
          "store": false
        },
        /* fileID. used for deletion and Symbol.exec.pcrange collision handling on symbolization */
        "Symbol.file.id": {
          "type": "keyword",
          "index": true,
          "doc_values": false,
          "store": false
        },
        /* PC ranges [begin, end) */
        "Symbol.exec.pcrange": {
          "type": "ip_range",
          "index": true,
          "doc_values": false,
          "store": false
        }
      }
    }
  },
  "version": ${xpack.profiling.template.version}
}
