# Help with String map

**URL:** <https://community.f5.com/t/help-with-string-map/877>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [January 30, 2007, 2:01pm UTC](https://community.f5.com/t/help-with-string-map/877 "2007-01-30T14:01:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Abplanal](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Andrew\_Abplanal](https://community.f5.com/u/Andrew_Abplanal)\
**Post date:** [January 30, 2007, 2:01pm UTC](https://community.f5.com/t/help-with-string-map/877/1 "2007-01-30T14:01:46Z")

</div>

I am having issues with the " string map " command when using variables in the map section of the command.

Notice how the command logs the correct string when there is just text in the mapping setion…

ex.

if {[HTTP::is\_redirect]}{

set find “:25620/”

set replace “/”

set location [HTTP::header value Location]

HTTP::header replace Location [string map { $find $replace} $location]

log [string map {$find $replace} $location]

log [string map { “:25620/” “/”} $location]

}

}

Jan 30 09:58:43 tmm tmm[1385]: 01220002:6: Rule lng-ln-cert-certlexisgw.lexis.com-http : [http://www.test.com:25620/hbeat/](http://www.test.com:25620/hbeat/)

Jan 30 09:58:43 tmm tmm[1385]: 01220002:6: Rule lng-ln-cert-certlexisgw.lexis.com-http : [http://www.test.com/hbeat/](http://www.test.com/hbeat/)
