[pkg-netfilter-team] Bug#926411: Export to json/xml doesn't work

Michal Šafránek michal.safranek at dobris.net
Wed Jul 10 15:12:33 BST 2019


I found solution/workaround:
there is a parameter -j, which outputs to json format, so if you run nft with this parameter, you will get JSON formatted output.

nft -j list ruleset
{"nftables": [{"table": {"family": "inet", "name": "filter", "handle": 14}}, {"chain": {"family": "inet", "table": "filter", "name": "input", "handle": 1, "type": "filter", "hook": "input", "prio": 0, "policy": "accept"}}, {"chain": {"family": "inet", "table": "filter", "name": "forward", "handle": 2, "type": "filter", "hook": "forward", "prio": 0, "policy": "accept"}}, {"chain": {"family": "inet", "table": "filter", "name": "output", "handle": 3, "type": "filter", "hook": "output", "prio": 0, "policy": "accept"}}]}

It’s bit confusing, the man page refers to "nft export json“ and there is no mention about -j parameter…


S pozdravem

Michal Šafránek
Tel.: 775 610 810
E-mail: michal.safranek at dobris.net



More information about the pkg-netfilter-team mailing list