Dynamic replacement of URI components using headers/body

Hello, i am new to kong and i love it so far! However i have a question regarding dynamic replacement of URI components using headers/body.

I’m trying to reoute a user request from example.com/get-users to example.com/admin/realm/realmName/users.

I did that using the request transformer plugin and it worked perfectly! However, is there a way that i can make the “realmName” in the uri dynamic? such that the user passes the realm name through headers and i replace the uri component “realmName” with the passed header?

For reference, here’s my yaml file for the request transoformer plugin:

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
name: request-transformer-plugin
namespace: my-namespace
uri: “/admin/realms/realmname/users”
plugin: request-transformer