Skip to main content
Version: 3.9

Plugin Metadata


In this document, you will learn the basic concept of plugin metadata in APISIX and why you may need them.

Explore additional resources at the end of the document for more information on related topics.


In APISIX, a plugin metadata object is used to configure the common metadata field(s) of all plugin instances sharing the same plugin name. It is useful when a plugin is enabled across multiple objects and requires a universal update to their metadata fields.

The following diagram illustrates the concept of plugin metadata using two instances of syslog plugins on two different routes, as well as a plugin metadata object setting a global log_format for the syslog plugin:

Without otherwise specified, the log_format on plugin metadata object should apply the same log format uniformly to both syslog plugins. However, since the syslog plugin on the /orders route has a different log_format, requests visiting this route will generate logs in the log_format specified by the plugin in route.

Metadata properties set at the plugin level is more granular and has a higher priority over the "global" metadata object.

Plugin metadata objects should only be used for plugins that have metadata fields. Check the specific plugin documentation to know more.

Example usage#

The example below shows how you can configure through the Admin API:

curl \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
"log_format": {
"host": "$host",
"@timestamp": "$time_iso8601",
"client_ip": "$remote_addr"

With this configuration, your logs would be formatted as shown below:


Additional Resource(s)#

Key Concepts - Plugins