Skip to main content
Version: 3.8

APISIX variable

Description#

Besides NGINX variable, APISIX also provides additional variables.

List of variables#

Variable NameOriginDescriptionExample
balancer_ipcoreThe IP of picked upstream server.192.168.1.2
balancer_portcoreThe port of picked upstream server.80
consumer_namecoreUsername of Consumer.
consumer_group_idcoreGroup ID of Consumer.
graphql_namecoreThe operation name of GraphQL.HeroComparison
graphql_operationcoreThe operation type of GraphQL.mutation
graphql_root_fieldscoreThe top level fields of GraphQL.["hero"]
mqtt_client_idmqtt-proxyThe client id in MQTT protocol.
route_idcoreId of Route.
route_namecoreName of Route.
service_idcoreId of Service.
service_namecoreName of Service.
redis_cmd_lineRedisThe content of Redis command.
resp_bodycoreIn the logger plugin, if some of the plugins support logging of response body, for example by configuring include_resp_body: true, then this variable can be used in the log format.
rpc_timexRPCTime spent at the rpc request level.

You can also register your own variable.