简体   繁体   中英

Expecting 'STRING', got 'EOF'

I'm trying to create a config.gateway.json file for a Ubiquiti firewall and I need to upload the file to it. I go to the website jsonlint.com and try to run the following into it:

{
    "LOAD_BALANCE": {
        "description": "LOAD_BALANCE",
        "rule": {
            "2000": {
                "action": "modify",
                "modify": {
                    "lb-group": "wan2_failover"
            },
            "source": {
                "address": "172.16.7.0/24"
            },
            "interfaces": {
                "bridge": {
                    "br0": {
                            "aging": "300",
                            "bridged-conntrack": "disable",
                            "hello-time": "2",
                            "max-age": "20",
                            "priority": "32768",
                            "promiscuous": "disable",
                            "stp": "false"
                    }
                },
                "load-balance": {
                    "group": {
                        "wan2_failover": {
                            "flush-on-active": "disable",
                            "interface": {
                                "br0": {
                                    "failover-only": "''"
                                },
                                "eth0": "''"
                            },
                            "lb-local": "enable",
                            "lb-local-metric-change": "enable"
                        },

but I get the error Expecting 'STRING', got 'EOF'

If one of the fine Java gurus could help me I'd appreciate it!

It looks like your JSON has some unbalanced curly brackets. Maybe this is what you're after:

{
    "LOAD_BALANCE": {
        "description": "LOAD_BALANCE",
        "rule": {
            "2000": {
                "action": "modify",
                "modify": {
                    "lb-group": "wan2_failover"
                },
                "source": {
                    "address": "172.16.7.0/24"
                },

                "interfaces": {
                    "bridge": {
                        "br0": {
                            "aging": "300",
                            "bridged-conntrack": "disable",
                            "hello-time": "2",
                            "max-age": "20",
                            "priority": "32768",
                            "promiscuous": "disable",
                            "stp": "false"
                        }
                    },

                    "load-balance": {
                        "group": {
                            "wan2_failover": {
                                "flush-on-active": "disable",
                                "interface": {
                                    "br0": {
                                        "failover-only": "''"
                                    },
                                    "eth0": "''"
                                },
                                "lb-local": "enable",
                                "lb-local-metric-change": "enable"
                            }
                        }
                    }
                }
            }
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM