<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - set elements missing from json output"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1495">1495</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>set elements missing from json output
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>nft
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pablo@netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>5bbcc2f9@opayq.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>if I use the wiki example from page
<a href="https://wiki.nftables.org/wiki-nftables/index.php/Meters">https://wiki.nftables.org/wiki-nftables/index.php/Meters</a>:

% nft add table my_filter_table
% nft add chain my_filter_table my_input_chain {type filter hook input priority
0\;}
% nft add set my_filter_table my_ssh_meter { type ipv4_addr\; flags dynamic \;}
% nft add rule my_filter_table my_input_chain tcp dport 22 ct state new add
@my_ssh_meter { ip saddr limit rate 10/second } accept

the text listing of the ruleset is correct:

% nft list ruleset
table ip my_filter_table {
        set my_ssh_meter {
                type ipv4_addr
                size 65535
                flags dynamic
        }

        chain my_input_chain {
                type filter hook input priority filter; policy accept;
                tcp dport 22 ct state new add @my_ssh_meter { ip saddr limit
rate 10/second } accept
        }
}

the json version of the same thing appears to omit the rate limiting clause:

% nft -j list ruleset
{"nftables": [{"metainfo": {"version": "0.9.8", "release_name": "E.D.S.",
"json_schema_version": 1}}, {"table": {"family": "ip", "name":
"my_filter_table", "handle": 39}}, {"set": {"family": "ip", "name":
"my_ssh_meter", "table": "my_filter_table", "type": "ipv4_addr", "handle": 2,
"size": 65535}}, {"chain": {"family": "ip", "table": "my_filter_table", "name":
"my_input_chain", "handle": 1, "type": "filter", "hook": "input", "prio": 0,
"policy": "accept"}}, {"rule": {"family": "ip", "table": "my_filter_table",
"chain": "my_input_chain", "handle": 3, "expr": [{"match": {"op": "==", "left":
{"payload": {"protocol": "tcp", "field": "dport"}}, "right": 22}}, {"match":
{"op": "in", "left": {"ct": {"key": "state"}}, "right": "new"}}, {"set": {"op":
"add", "elem": {"payload": {"protocol": "ip", "field": "saddr"}}, "set":
"@my_ssh_meter"}}, {"accept": null}]}}]}

As a easy check, the number "10" does not appear in the json output, but does
in the text output.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>