Skip to content
jc-rs
GitHub

iptables

--iptablesv1.12.0

Converts `iptables` command output to JSON

Linuxcommand
$ iptables | jc-rs --iptables

A real pair

From the reference corpus (ubuntu-18.04/iptables-raw.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

iptablesubuntu-18.04
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "chain": "PREROUTING",
    "rules": []
  },
  {
    "chain": "OUTPUT",
    "rules": []
  }
]

Fixture coverage

12/12oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs iptablesjc-rs runs the command itself and parses what it prints. Recognised for: `iptables`

Source: crates/jc-rs-parsers/src/security/iptables.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare