iptables is totally screwed up, but have you tried nftables?
I've converted all my Linux servers to nftables specifically due to its syntax similarity to BSD
No, you can do both in nftables. Either command-line one liners:
nft add element inet main ossec4 { 10.10.10.10, 10.10.10.20 }
Or the same in config file format which is more suitable for atomic loads.