<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 - `nft -j list set` does not show counters"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1462">1462</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>`nft -j list set` does not show counters
          </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>normal
          </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>dev@doubly.so
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have a set with counters. I can see their values in a rather unreadable
format:

# nft list set inet dev ports_udp
table inet dev {
    set ports_udp {
        type inet_service
        size 65536
        flags dynamic,timeout
        timeout 30d
        elements = { 53 expires 29d23h58m25s672ms counter packets 35 bytes
2515, 389 expires 29d23h59m15s144ms counter packets 1 bytes 80, 515 expires
29d23h56m14s136ms counter packets 1 bytes 57, 1194 expires 29d23h58m18s460ms
counter packets 2 bytes 84, 1504 expires 29d23h51m14s28ms counter packets 1
bytes 223,
   ...
}

So I would like to format them myself. For that, JSON output would be much more
useful. However the JSON output does not include the values:

# nft -j list set inet dev ports_udp | jq
{
  "nftables": [
    {
      "metainfo": {
        "version": "0.9.6",
        "release_name": "Capital Idea #2",
        "json_schema_version": 1
      }
    },
    {
      "set": {
        "family": "inet",
        "name": "ports_udp",
        "table": "dev",
        "type": "inet_service",
        "handle": 7,
        "size": 65536,
        "flags": [
          "timeout"
        ],
        "timeout": 2592000,
        "elem": [
          {
            "elem": {
              "val": 53,
              "expires": 2591982
            }
          },
   ...
}

I would expect the JSON output to be _at least_ as complete as the human
readable output. Even if the counter had to be described as a string, it would
be better than nothing.

Thanks,
Devin</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>