I'm trying to work out if there is a simple way to use nft to dynamically build a list of saddr and count the packets/bytes on each of them. I don't want to apply any limits on traffic - just measure it.
I know how to build a dynamic set and add discovered saddrs to it. but I'm failing to find any syntax which would allow me to add a counter for each saddr.
I know how to add a counter to the rule which adds saddrs to the set. ( not what I want though )
I know how to create and use an explicit counter for an individual named saddr.
I know I could use the knowledge I have already to create a dynamic set - examine it and then create individual rules for each saddr but it just seems there must be a better way to do this.
I see plenty of examples of connection limiting code which when listed suggest a count is available but none which seem directly applicable ( and none which seem to pass syntax checking by nft on my machine ).
I'm running this in a raspberry pi 4 ( raspbian buster ), kernel version 5.4.51 and nftables v0.9.0 (Fearless Fosdick)
I'm a complete nft beginner.