0

精度会因大数字而丢失。我正在使用尾部输入插件来读取文件,文件中的数据是 json 格式。下面是配置

[inputs.tail]]
    files = ["E:/Telegraph/MSTCIVRRequestLog_*.json"]
    from_beginning = true
    name_override = "tcivrrequest"
    data_format = "json"
    json_strict = true

[[outputs.file]]
    files = ["E:/Telegraph/output.json"]
    data_format = "json"

输入文件包含

{"RequestId":959011990586458245}

预期产出

{"fields":{"RequestId":959011990586458245},"name":"tcivrrequest","tags":{},"timestamp":1632994599}

实际输出

{"fields":{"RequestId":959011990586458200},"name":"tcivrrequest","tags":{},"timestamp":1632994599}

数字 959011990586458245 转换为 959011990586458200(检查最后几位数字)。

已经在下面尝试过但没有用

json_string_fields = ["RequestId"]

[[processors.converter]] [processors.converter.fields] 字符串 = [""RequestId""]"

精度 = "1s"

json_int64_fields = ["RequestId"]

character_encoding = "utf-8"

json_strict = true

4

0 回答 0