Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Slavko <linux@slavino.sk>
To: "netfilter ML" <netfilter@vger.kernel.org>
Subject: Re: Sets update
Date: Sun, 21 Jul 2024 19:58:36 +0200	[thread overview]
Message-ID: <20240721195836.340f65f1@bonifac.skk> (raw)
In-Reply-To: <ba07a45c-7564-4b40-92de-ea698d16f49f@app.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 1243 bytes --]

Hi,

Dňa Sun, 21 Jul 2024 10:58:30 +0100 "Kerin Millar" <kfm@plushkava.net>
napísal:

> Mind you, it gets worse. While the nft utility supports a JSON output
> mode to ease parsing, its output is less accurate than the
> conventional output mode in so far as all "timeout" and "expires"
> values are truncated to integer seconds and conveyed as JSON integers.

Even worse, the JSON output lacks counters at all, the nft output:

    ...
    elements = { IP.AD.DR.ES last used never counter packets 0 bytes 0\
                     expires 1d23h36m40s340ms
    ...

But JSON output lacks counters:

    nft -j list set ... | jq '.nftables[] | select(.set != null).set.elem[0]'
    { "elem": {
        "val": "IP.AD.DR.ES",
        "expires": 171653,
        "last": null
      }
    }

And yes, error messages are more than cryptic... We was talking about
memory usage, and my first attempt to add/update list of ~2700 items
ended with "Out of memory" error. First i was shocked, 2700 items
consumes 6GB RAM??? It took some time to realize, that i had duplicate
IPs in list. Really not helpful error message, and one element per line
doesn't help with that...

regards

-- 
Slavko
https://www.slavino.sk

[-- Attachment #2: Digitálny podpis OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2024-07-21 17:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  7:44 Sets update Slavko
2024-07-21  9:58 ` Kerin Millar
2024-07-21 10:04   ` Kerin Millar
2024-07-21 11:23   ` Slavko
2024-07-21 12:29     ` Kerin Millar
2024-07-21 14:38       ` Slavko
2024-07-21 15:46         ` Kerin Millar
2024-07-23  7:24       ` Slavko
2024-07-23  7:37         ` Slavko
2024-07-23  9:39         ` Pablo Neira Ayuso
2024-07-23 10:23           ` Slavko
2024-07-23 11:32           ` Kerin Millar
2024-07-23 12:19             ` Pablo Neira Ayuso
2024-07-21 16:09   ` Eric
2024-07-21 16:46     ` Kerin Millar
2024-07-21 17:58   ` Slavko [this message]
2024-07-22 20:36   ` Pablo Neira Ayuso
2024-07-23  7:26     ` Slavko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240721195836.340f65f1@bonifac.skk \
    --to=linux@slavino.sk \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox