[Bug 1462] New: `nft -j list set` does not show counters

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Fri Sep 4 11:09:40 CEST 2020


https://bugzilla.netfilter.org/show_bug.cgi?id=1462

            Bug ID: 1462
           Summary: `nft -j list set` does not show counters
           Product: nftables
           Version: unspecified
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: nft
          Assignee: pablo at netfilter.org
          Reporter: dev at doubly.so

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

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20200904/11335a5a/attachment-0001.html>


More information about the netfilter-buglog mailing list