# Example taken from: https://github.com/influxdata/telegraf/issues/7097

# Parse String types from JSON
[[inputs.file]]
    files = ["./testdata/types/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
        [[inputs.file.json_v2.field]]
        rename = "explicitstringtypeName"
        path = "explicitstringtype"
        type = "string"
        [[inputs.file.json_v2.field]]
        rename = "defaultstringtypeName"
        path = "defaultstringtype"
        [[inputs.file.json_v2.field]]
        rename = "convertbooltostringName"
        path = "convertbooltostring"
        type = "string"
        [[inputs.file.json_v2.field]]
        rename = "convertinttostringName"
        path = "convertinttostring"
        type = "string"
        [[inputs.file.json_v2.field]]
        rename = "convertfloattostringName"
        path = "convertfloattostring"
        type = "string"

# Parse int typess from JSON
[[inputs.file]]
    files = ["./testdata/types/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
        [[inputs.file.json_v2.field]]
        rename = "explicitinttypeName"
        path = "explicitinttype"
        type = "int"
        [[inputs.file.json_v2.field]]
        rename = "uinttype"
        path = "explicitinttype"
        type = "uint"
        [[inputs.file.json_v2.field]]
        rename = "defaultinttypeName"
        path = "defaultinttype"
        [[inputs.file.json_v2.field]]
        rename = "convertfloatointName"
        path = "convertfloatoint"
        type = "int"
        [[inputs.file.json_v2.field]]
        rename = "convertstringtointName"
        path = "convertstringtoint"
        type = "int"
        [[inputs.file.json_v2.field]]
        rename = "convertbooltointName"
        path = "convertbooltoint"
        type = "int"

# Parse float types from JSON
[[inputs.file]]
    files = ["./testdata/types/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
        [[inputs.file.json_v2.field]]
        rename = "explicitfloattypeName"
        path = "explicitfloattype"
        type = "float"
        [[inputs.file.json_v2.field]]
        rename = "defaultfloattypeName"
        path = "defaultfloattype"
        [[inputs.file.json_v2.field]]
        rename = "convertintotfloatName"
        path = "convertintotfloat"
        type = "float"
        [[inputs.file.json_v2.field]]
        rename = "convertstringtofloatName"
        path = "convertstringtofloat"
        type = "float"

# Parse bool types from JSON
[[inputs.file]]
    files = ["./testdata/types/input.json"]
    data_format = "json_v2"
    [[inputs.file.json_v2]]
        [[inputs.file.json_v2.field]]
            rename = "explicitbooltypeName"
            path = "explicitbooltype"
            type = "bool"
        [[inputs.file.json_v2.field]]
            rename = "defaultbooltypeName"
            path = "defaultbooltype"
        [[inputs.file.json_v2.field]]
            rename = "convertinttoboolName"
            path = "convertinttobool"
            type = "bool"
        [[inputs.file.json_v2.field]]
            rename = "convertstringtoboolName"
            path = "convertstringtobool"
            type = "bool"
        [[inputs.file.json_v2.field]]
            rename = "convertintstringtoboolTrueName"
            path = "convertintstringtoboolTrue"
            type = "bool"
        [[inputs.file.json_v2.field]]
            rename = "convertintstringtoboolFalseName"
            path = "convertintstringtoboolFalse"
            type = "bool"
