このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
互換性のあるプロトコル
jqプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
jq。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
consumer.name or consumer.id
stringプラグインがターゲットとするコンシューマーの名前または ID。 最上位の
/pluginsエンドポイント. からコンシューマーにプラグインを追加する場合は、これらのパラメーターのいずれかを設定してください/consumers/{consumerName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
request_jq_program
stringThe jq program to run on the request body. For example,
.[0] | { "X-Foo": .foo }. Eitherrequest_jq_programorresponse_jq_pluginmust be included in the configuration.
-
request_jq_program_options
recordBoolean option flags to modify the run behavior of the jq program run on the request body.
-
compact_output: Returns output in a compact form without additional spacing, and with each JSON object on a single line. Defaults totrue. Set tofalsefor ‘pretty’ output. -
raw_output: Outputs as raw strings, not JSON quoted. Default isfalse. -
join_output: Similar toraw_outputbut does not output newline separators. Default isfalse. -
ascii_output: jq usually outputs non-ASCII Unicode codepoints as UTF-8, even if the input specified them as escape sequences (likeμ). Using this option, you can force jq to produce pure ASCII output, replacing every non-ASCII character with the equivalent escape sequence. Default isfalse. -
sort_keys: Outputs the fields of each object with the keys in sorted order. Default isfalse.
-
compact_output
boolean required default:true
-
raw_output
boolean required default:false
-
join_output
boolean required default:false
-
ascii_output
boolean required default:false
-
sort_keys
boolean required default:false
-
-
request_if_media_type
array of typestringdefault:application/jsonA list of media type strings. The media type included in the
Content-Typerequest header must match one of the media types on this list for the program to run.
-
response_jq_program
stringThe jq program to run on the response body. For example,
.[0] | { "X-Foo": .foo }. Eitherrequest_jq_programorresponse_jq_pluginmust be included in configuration.
-
response_jq_program_options
recordBoolean option flags to modify the run behavior of the jq program run on the response body.
-
compact_output: Returns output in a compact form without additional spacing, and with each JSON object on a single line. Defaults totrue. Set tofalsefor ‘pretty’ output. -
raw_output: Outputs as raw strings, not JSON quoted. Default isfalse. -
join_output: Similar toraw_outputbut does not output newline separators. Default isfalse. -
ascii_output: jq usually outputs non-ASCII Unicode codepoints as UTF-8, even if the input specified them as escape sequences (likeμ). Using this option, you can force jq to produce pure ASCII output, replacing every non-ASCII character with the equivalent escape sequence. Default isfalse. -
sort_keys: Outputs the fields of each object with the keys in sorted order. Default isfalse.
-
compact_output
boolean required default:true
-
raw_output
boolean required default:false
-
join_output
boolean required default:false
-
ascii_output
boolean required default:false
-
sort_keys
boolean required default:false
-
-
response_if_media_type
array of typestringdefault:application/jsonA list of media type strings. The media type included in the
Content-Typeresponse header must match one of the media types on this list for the program to run.
-
response_if_status_code
array of typeintegerdefault:200A list of HTTP response status codes. The response status code must match one of the response status codes on this list for the program to run.
-