YAML 0 开头的问题

Avoid using leading zeros in numeric valuesedit

If you use a leading zero (for example, 09) in a numeric field without wrapping the value in single quotation marks, the value may be interpreted incorrectly by the YAML parser. If the value is a valid octal, it’s converted to an integer. If not, it’s converted to a float.

To prevent unwanted type conversions, avoid using leading zeros in field values, or wrap the values in single quotation marks.

如果您在数字字段中使用前导零(例如:09)而不将值括在单引号中,则 YAML 解析器可能会错误地解释该值。如果该值是有效的八进制,则将其转换为整数。如果不是,则将其转换为浮点数

为防止不需要的类型转换,请避免在字段值中使用前导零,或将值括在单引号中。

参考:
https://www.elastic.co/guide/en/beats/filebeat/current/yaml-tips.html#avoid-leading-zeros

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值