Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated Links

...

Code Block
languagexml
themeConfluence
titleBasic [filter name] configuration
 <?xml version="1.0" encoding="UTF-8"?>
<url-extractor-to-header xmlns="http://docs.openrepose.org/repose/url-extractor-to-header/v1.0">
    <!-- Grab the Device ID from the path immediately preceding 'entities'; default to an empty header -->
    <extraction header="X-Device-Id" url-regex=".*/(hybrid:\d+)/entities/.+" default=""/>

    <!-- Grab the Server ID from the resource immediately following 'servers'; don't include header if URL doesn't match -->
    <extraction header="X-Server-Id" url-regex=".*/servers/([^/]+).*"/>

    <!-- Grab the filter parameter; default to 'none' if a filter wasn't supplied -->
    <extraction header="X-Filter-Param" url-regex=".*\?.*filter=([^&amp;]+).*" default="none"/>
</url-extractor-to-header>

Configurable parameters

XML schema definition

Example configuration

 

The url-extractor-to-header.cfg.xml file contains the following elements and attributes. Add the filter to your Repose deployment through the system model configuration.

ElementsAttributes

Required/

Optional

Description
<url-extractor-to-header>-RequiredSpecifies the sub-elements and attributes to define your filter configuration.
<extraction>-RequiredElement to configure a URL extraction to a header.
Image Modified
headerRequiredThe name of the header to create.
Image Modified
url-regexRequiredThe regular expression to apply to the URL to get the header value.
Image Modified
defaultOptionalIf this attribute is not present and the URL doesn't match the url-regex, the header will not be created.
If this attribute is present and the URL doesn't match the url-regex, the header will be created using the value of this attribute.
If the URL does match the url-regex, this value is not used.

Return codes and conditions

...