split an accounting attribute in two and write two new attributes to MySQL

Alan DeKok aland at deployingradius.com
Mon Feb 14 16:49:37 UTC 2022


On Feb 14, 2022, at 11:40 AM, <xaled at web.de> <xaled at web.de> wrote:
> In preacct section of default config from sites enabled I added
> 
> Split-Session-ID = "%{explode:%{Acct-Session-Id} /}"

  You can't just add random things to the configuration files.  Any attribute editing as to go into an "update" section.  The documentation shows this, and there are many examples of it in the configuration files.

> And immediately get error:
> 
> /etc/freeradius/3.0/sites-enabled/default[558]: Unknown action
> '%{explode:%{Acct-Session-Id}/}'.

  This only happens if the attribute editing it's in an "update" section.

> In mysql mapping config I added

  I don't know what "mysql mapping config" is.  Perhaps give the filename?

>            '{%Split-Session-ID:1}', \
> 
>            '{%Split-Session-ID:2}', \

  That won't do what you want, either.  I think you're trying to access multiple values of the "Split-Session-ID" attribute?  But you're not saying, so I can only guess.  And the expansion syntax you're using is completely wrong. 

  See the documentation for how to reference multiple values of one attribute.  It's normal array offset syntax, using [0], [1], etc.  See the documentation for the expansion syntax... it's %{Name}.  Not {%nName}

 You also need to define the Split-Session-Id attribute in raddb/dictionary.  I suspect that you haven't done that.

  You can't just edit the MySQL queries to add new fields.  The SQL queries put values in specific columns, which have pre-defined meanings.

  And it helps to *explain* what you're doing.  Give details.  The less information you give, the harder it is to help you.

  Alan DeKok.



More information about the Freeradius-Users mailing list