title: elasticsearch - index template creation error - parse exception, unknown key
body: <p>I just recently upgraded my cluster from 6.1.x to 7.9.x version. Trying to fix index templates so in that when my data is pushed in a moment after midnight, new daily index is created automatically.</p>
  <p>Here is how I do it:</p>
  <pre><code>## create template and mapping
   
  PUT http://es1:9200/_template/tmp_staging_devices_1
  {
      &quot;template&quot;: &quot;staging-devices-*&quot;,
      &quot;settings&quot;: {
          &quot;number_of_shards&quot;: 3
      },
      &quot;mappings&quot;: {
          &quot;properties&quot;: {
              &quot;ts&quot;: {&quot;type&quot;: &quot;date&quot;, &quot;format&quot;: &quot;epoch_millis&quot;},
              &quot;server_ts&quot;: {&quot;type&quot;: &quot;date&quot;, &quot;format&quot;: &quot;epoch_millis&quot;},
              &quot;raw&quot;: {&quot;type&quot;: &quot;binary&quot;}
          }
      }
  }
   
  ## template is listed under the list of templates
   
  ## trying to put some data into the elasticsearch
  PUT http://es1:9200/staging-devices-2020-10-20
  {
      &quot;imei&quot;: &quot;24779610124313&quot;,
      &quot;json&quot;: &quot;{\&quot;imei\&quot;:\&quot;357796101614313\&quot;,\&quot;ts\&quot;:1603180834000,\&quot;values\&quot;:{\&quot;coreMsgId\&quot;:2810,\&quot;obdIt\&quot;:{\&quot;distance\&quot;:0,\&quot;distanceCombustion\&quot;:0,\&quot;idleTime\&quot;:0,\&quot;idleTimeCombustion\&quot;:0,\&quot;maxSpeed\&quot;:0,\&quot;totalEnergyCons\&quot;:0,\&quot;totalFuelCons\&quot;:0,\&quot;totalTime\&quot;:488,\&quot;totalTimeCombustion\&quot;:0}}}&quot;,
      &quot;raw&quot;: &quot;04 00 00 32 0A 18 08 FA 15 32 13 08 00 10 00 18 00 20 00 28 E8 03 30 00 38 00 40 00 48 00 12 0F 33 35 37 37 39 36 31 30 31 36 31 34 33 31 33 18 C2 EE CE D1 CB 2E&quot;,
      &quot;server_ts&quot;: 1603180834000,
      &quot;ts&quot;: 1603180834000
  }
   
   
  ## error that I get back (400 bad request)
  {
    &quot;error&quot;: {
      &quot;root_cause&quot;: [
        {
          &quot;type&quot;: &quot;parse_exception&quot;,
          &quot;reason&quot;: &quot;unknown key [server_ts] for create index&quot;
        }
      ],
      &quot;type&quot;: &quot;parse_exception&quot;,
      &quot;reason&quot;: &quot;unknown key [server_ts] for create index&quot;
    },
    &quot;status&quot;: 400
  }
  </code></pre>
  <p>What am I doing wrong?</p>
  <p>The only difference from the &quot;old system&quot; is that I removed &quot;values&quot;</p>
  <pre><code>{
      &quot;template&quot;: &quot;staging-devices*&quot;,
      &quot;settings&quot;: {
          &quot;number_of_shards&quot;: 1
      },
      &quot;mappings&quot;: {
          &quot;values&quot;: {
              &quot;properties&quot;: {
                  &quot;ts&quot;: {&quot;type&quot;: &quot;date&quot;, &quot;format&quot;: &quot;epoch_millis&quot;},
                  &quot;server_ts&quot;: {&quot;type&quot;: &quot;date&quot;, &quot;format&quot;: &quot;epoch_millis&quot;},
                  &quot;raw&quot;: {&quot;type&quot;: &quot;binary&quot;}
              }
          }
      }
  }
  </code></pre>