Forum Discussion
Tidux_92112
Nimbostratus
Aug 09, 2005How to insert certificate serial number and ssl verify result to http header both ?
As above, I want to deliver ssl cert serial number to http server behind BIG-IP, and redirect the users who has no cert to an error page at same time.
It looks like that if I use two "sessio...
Rickin_110451
Nimbostratus
Jun 15, 2011Also sorry should add that the Developer wants Session stickiness which I believe is set by default. So all HTTP GETS within a session should have the same cookie
- Kevin_StewartJul 20, 2015
Employee
Something like this:
set example {custom_string_foo=[get this data w/out the brackets], custom_string_bar=[get this data too],custom_string_again=[keep getting data until no more instances of custom_string]} foreach x [split $example ","] { log local0. [findstr $x "\[" 1 "\]"] }
The split command breaks the larger string into list items, and then the foreach loops through that list and extracts the string between the brackets using the findstr command.
- Kevin_StewartJul 20, 2015
Employee
The string values don't matter at all. All you care about is that the strings are separated by commas, and that the data you want inside each string is inside square brackets.
set str {test1=[foo],test2=[bar],test3=[blah]} foreach x [split $str ","] { log local0. [findstr $x "\[" 1 "\]"] }
returns:
foo bar blah
- Kevin_StewartJul 20, 2015
Employee
You can use two options. The first option is to create a simple list object:
set str {test1=[foo],test2=[bar],test3=[blah]} set mylist [list] foreach x [split $str ","] { lappend mylist [lindex [split $x "="] 0] lappend mylist [findstr $x "\[" 1 "\]"] } log local0. "mylist = $mylist" foreach y $mylist { log local0. $y }
The output of this would be:
mylist = test1 foo test2 bar test3 blah test1 foo test2 bar test3 blah
Where the odd index is the key and the next even index is the value. Or you can use an array:
set str {test1=[foo],test2=[bar],test3=[blah]} foreach x [split $str ","] { set thisarray([lindex [split $x "="] 0]) [findstr $x "\[" 1 "\]"] } foreach {index value} [array get thisarray] { log local0. "$index = $value" }
It's output would be:
test1 = foo test2 = bar test3 = blah
And then you could access these associative array indices individually.
log local0. $thisarray(test2)