Re: v4 how to insert reply attributes in the radpostauth sql query?

Alan DeKok via Freeradius-Users <[email protected]> Thu, 26 Mar 2026 06:54:38 +1300
Newsgroups gmane.comp.freeradius.user
Message-ID <[email protected]>
On Mar 25, 2026, at 11:44 PM, James Wood via Freeradius-Users <[email protected]> wrote:
> Just before we perform the insert, I am trying to get all of the reply
> attributes we're sending as described here:
> 
> https://www.freeradius.org/documentation/freeradius-server/4.0.0/reference/xlat/pairs/print.html
> 
> &control.Tmp-String-9 := "%pairs.print(reply.[*])"

  You don't need quotes around the %pairs.print() call.  But you likely need to quote the reply.[*] argument.

> and then referencing the tmp string on the query.

  Or, just use %pairs.print() directly.

> I get:
> 
> %pairs.print(reply.[*])
> ^: Unresolved expansion functions are not allowed here
> 
> Any thoughts? If this isn't the right way, please advise how I can get
> these reply attributes into a string ready for the sql insert.

  The %pairs.print() function is in the current git "master" branch.  It's tested in CI on every commit.

$ git grep 'pairs.print' src/tests/keywords
src/tests/keywords/pairs:result_string := "%str.concat(%pairs.print('Tmp-Group-0.[*]'), ', ')"
src/tests/keywords/pairs:result_string := "%pairs.print('Tmp-Group-0.Filter-Id')"
...

  Make sure you're using a recent version of v4.  If you're running something from many months ago, it will out of date.

  Alan DeKok.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEIUl02elqcIsf1zM0v3SJ0h7dTTMFAmnEIV4ACgkQv3SJ0h7d
TTPBHw/7BfomJwflv1PS3iORmGdZSMhr6L+TfY+MzwzECV4gtzLpIQivAACBrRKr
4ICLBbYumHJcHQ2G8PYc2Qw+Qed/tp+F4rA6GndW/u0AUUSGXbFA44Wjfi3C+WWV
xv/RZBGMGoTUbsKa6kcDoG9fh3g+Jd5CWkfNJYKDFjRD6Z+N/ScK9Wlo4NgcWRzC
x7ZhzhqMyTXA/99z5YQawYtfqaACqtd3MGhT/Ix5KFvUsXoQoCaFgH0vsTzPjti8
JiVGabucMtGLzSidFjCjlz6INSlX3bxMGmnF0dipUx4biXhFquwP8A1jPvumxeB5
DQiQ/eCvibkN7p4wMH85mzwYm6h+IWR7eB2EK+AYDKy03xVuYnx9Qkt5KL7t5ad8
Xj7yrSLS3qfOQ5pckyyByCsrKi9YJtuByfd7nops8P2I6zG3cXvL06z1HIGg0ie/
wFtmlCsVy80PHnU2mV7/YBEUYLkXhS8CMTnsphkPlwkE8rTYWu0U4b/dy84vDULG
+SC7Ntqcj+jZ2EiYcUy3smsATi3AcRs7+dUWaG8qzpwZQ4yBUgzr8/HWGAvw56U8
YJa+56Wrd9yInEn2UInNhUY/l7zczn2OKpyGsaNKwbhntfV2Z7l5pCDoi5WNZHe3
n1VoxOHMiwGbmMeZlGzu3CMomuiZNuoWa+Jn4/4QLaXFhEFLkng=
=MIhZ
-----END PGP SIGNATURE-----