Skip to contentSkip to conversation

nftables' ulogd2 group "#" usage -- variable substitution possible?

DISCUSSION pgnd 1 participant 1 message Aug 23, 2024

lore
Share & tools
lore

pgnd

author
#0 lore raw

i've built/installed nft + ulogd2 from sources, master branch

both are available

	nft -V
		nftables v1.1.0 (Commodore Bullmoose)
		  cli:          editline
		  json:         yes
		  minigmp:      no
		  libxtables:   no

	ulogd -V
		ulogd Version 2.0.8
		(C) 2000-2006 Harald Welte <[email protected]>
		(C) 2008-2012 Pablo Neira Ayuso <[email protected]>
		(C) 2008-2012 Eric Leblond <[email protected]>

and generally work as expected

rule logging, e.g.

	meta l4proto {tcp} th dport 22 log prefix "SSH DROP: " group 2 drop;

works as intended

for convenience/readability, I define an alias var

define $LOG_ssh = 2

but attempt to

	meta l4proto {tcp} th dport 22 log prefix "SSH DROP: " group $LOG_ssh drop;

returns

	./test.nft:123:63-63: Error: syntax error, unexpected '$', expecting number
		meta l4proto {tcp} th dport 22 log prefix "SSH DROP: " group $LOG_ssh drop;

vars clearly work elsewhere.

is variable non-use intended/expected here?
or is my usage incorrect?