This reference wiki describes the usage and operation of offset and neg-offset function in rules/policies to assist in rewrite (transformation) and persist policy operations
Typically, a rule is used to match certain string/content (e.g. string in URL or value in header field) in order to perform a rewrite or persist policy operation. If the match was successful, a rewrite/persist string begins after the matched content. This is equivalent to offset 0 and offset 0 is assumed if not specified. If you want to move the starting point for rewrite/persist to another point, use the offset and neg-offset commands.
rewrite insert: If you want to move the starting point for rewrite insert operations, use the offset/neg-offset <value> operation
rewrite delete: If you want to move the starting point for rewrite delete operation and specify how many bytes/character should be deleted, use the offset/neg-offset <value> <length> operation
persist: If you want to specify which characters/bytes should be used for persistence string, use the offset/neg-offset <value> <length> operation
In the case of an 'exists' , 'pattern', 'equals' operator, the offset begins at the end of the value.
rewrite GET /abc/xyz/srv2default_index.html => GET /abc/xyz/default_index.html
csw-rule r1 url pattern "srv2default_"
match r1 rewrite request-delete neg-offset 12 4 Neg-offset 12 specifics to start rewrite delete 12 character back from "_" which means after "xyz/" and length 4 specifices to remove the following 4 characters "srv2" .