The CSV map can be used in a `map` section, as in the following example.
- map csv &User-Name {
+ map csv User-Name {
}
The argument to "map" is dynamically expanded. The result is taken
If a data type other than the native type of `key` expression
is needed, the casting operator can be used.
For example:
-a key value of `<ipv4prefix>&reply.Reply-Message`.
+a key value of `(ipv4addr) reply.Reply-Message`.
would result in a prefix trie being used for lookups, and the
`string` value of the `link:https://freeradius.org/rfc/rfc2865.html#Reply-Message[Reply-Message]` attribute being parsed as
CIDR notation.
as given the the key` field above. For example, the map could
look like this:
-map csv &User-Name {
-&reply.Reply-Message := 'color'
-&my-integer := 'count'
+map csv User-Name {
+reply.Reply-Message := 'color'
+my-integer := 'count'
}
This map does the same operations as the key / update
allow_multiple_keys = no
fields = "name,size,color,count"
index_field = "name"
- key = &User-Name
+ key = User-Name
update reply {
- &Reply-Message := 'color'
- &my-integer := 'count'
+ Reply-Message := 'color'
+ my-integer := 'count'
}
}
```
#
# The CSV map can be used in a `map` section, as in the following example.
#
-# map csv &User-Name {
+# map csv User-Name {
# Attribute-Name := field1
# Attribute-Name := field2
# ...
# If a data type other than the native type of `key` expression
# is needed, the casting operator can be used.
# For example:
- # a key value of `<ipv4prefix>&reply.Reply-Message`.
+ # a key value of `(ipv4addr) reply.Reply-Message`.
# would result in a prefix trie being used for lookups, and the
# `string` value of the `Reply-Message` attribute being parsed as
# CIDR notation.
# parsed to the final data type only when the `csv` module
# is run, either in-place, or as a `map`.
#
- key = &User-Name
+ key = User-Name
#
# ### Mapping of CSV fields to attributes.
# update { ... }::
#
update reply {
- &Reply-Message := 'color'
- &my-integer := 'count'
+ Reply-Message := 'color'
+ my-integer := 'count'
}
#
# as given the the key` field above. For example, the map could
# look like this:
#
- # map csv &User-Name {
- # &reply.Reply-Message := 'color'
- # &my-integer := 'count'
+ # map csv User-Name {
+ # reply.Reply-Message := 'color'
+ # my-integer := 'count'
# }
#
# This map does the same operations as the key / update