Scaling_factor is missing in generated template using ECS Tooling 1.7.0

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.

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

In template:

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

Anyone has seen this?

Thanks in advance for any help.

Meimei

Hi @mxu!

Proper support for the scaled_float type (along with it scaling_factor) was added to the ECS tooling recently 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:

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

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

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

mm

1 Like

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