# Scaling\_factor is missing in generated template using ECS Tooling 1.7.0

**URL:** <https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511>\
**Category:** Elasticsearch\
**Tags:** ecs-elastic-common-schema\
**Created:** [January 28, 2021, 2:18pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511 "2021-01-28T14:18:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxu](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mxu](https://discuss.elastic.co/u/mxu)\
**Post date:** [January 28, 2021, 2:18pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511/1 "2021-01-28T14:18:42Z")

</div>

Hi, I am adding a custom schema for CPU Usage, configured as following.  
The ECS Tooling 1.7.0 generated template without "scaling\_factor" field.

```auto
- name: 1MinAvg.Pct
      level: custom
      type: scaled_float
      scaling_factor: 100
      short: 1MinAvg percentage.
      description: >
         1MinAvg percentage.

```

In template:

```auto
       "1MinAvg": {
            "properties": {
              "Pct": {
                "type": "scaled_float"
              }
            }
          }

```

Anyone has seen this?

Thanks in advance for any help.

Meimei

---

<div class="post-metadata">

**Author:** ![ebeahan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebeahan/32/78989_2.png) [@ebeahan](https://discuss.elastic.co/u/ebeahan)\
**Post date:** [January 28, 2021, 7:40pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511/2 "2021-01-28T19:40:22Z")

</div>

Hi @mxu!

Proper support for the `scaled_float` type (along with it `scaling_factor`) was added to the ECS tooling [recently](https://github.com/elastic/ecs/pull/1042) and will be included in the upcoming ECS 1.8.0 release.

I suspect you're using `git checkout v1.7.0` to switch the target version to generate these 1.7.0 mappings? As a workaround, you can work from the `master` branch (which includes the support for `scaled_float`/`scaling_factor` in the generator) and use the `--ref` flag to target the 1.7.0 fields:

```auto
$ git checkout master
$ python scripts/generator.py --include </path/to/custom/files> --out </path/to/output> --ref v1.7.0

```

---

<div class="post-metadata">

**Author:** ![mxu](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mxu](https://discuss.elastic.co/u/mxu)\
**Post date:** [January 28, 2021, 8:34pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511/3 "2021-01-28T20:34:47Z")

</div>

Thanks a lot, Eric.  
I will try it out and post the result here.  
Thanks again,

---

<div class="post-metadata">

**Author:** ![mxu](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mxu](https://discuss.elastic.co/u/mxu)\
**Post date:** [February 1, 2021, 3:37pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511/4 "2021-02-01T15:37:58Z")

</div>

I followed instruction from Eric -- scaling\_factor was correctly included in the template.json.  
Thanks to Eric!

mm

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 1, 2021, 3:38pm UTC](https://discuss.elastic.co/t/scaling-factor-is-missing-in-generated-template-using-ecs-tooling-1-7-0/262511/5 "2021-03-01T15:38:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
