Forum Discussion
emilio_104458
Nimbostratus
Nov 30, 2011issue with newline
hi all,
i've a strange issue with an irule:
i can't add new line in a variable.
i try with:
set allHeaders [concat $allHeadersTemp '\n']
set allHeaders [concat $allHeadersTemp "\n"]
set allHeaders [concat $allHeadersTemp \n]
set allHeaders [concat $allHeadersTemp '\r\n\r\n']
set allHeaders [concat $allHeadersTemp '\r\n']
set allHeaders [concat $allHeadersTemp "\r\n"]
set allHeaders [concat $allHeadersTemp "\r\n\r\n"]
set allHeaders [append allHeadersTemp "\r\n\r\n"]
and so on....
but when i log the variable with
log local0.debug " $allHeader"
the results is alway a single line with blank space instead new line.
can u help me?
thanks in advice :)
2 Replies
- George_Watkins_Historic F5 AccountNewlines won't print in the log messages and the function you're looking for is called "join." I think the combination is what may be causing your issue here. Try printing them in an HTTP response like this and see how it works:
ltm rule concat_http_headers {when HTTP_REQUEST { set header_names [HTTP::header names] foreach header $header_names { lappend headers "$header: [HTTP::header value $header]" } HTTP::respond 200 content [join $headers "\n"]}}
Hope this helps,
George - emilio_104458
Nimbostratus
hi,
thanks for replay.
this variable is fill to send througth connect command to backend server, and the tcpdump on server side shows that newline doesn't arrive well formatted.
after a lot of test i think the problem is concat command and i've resolved using append in this way:
set invia [concat "GET " $myUri ]
append invia " HTTP/1.0\r\n\r\n"
thanks.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects