Forum Discussion
qqdixf5_74186
Nimbostratus
Apr 01, 2010Internal class format
Is this format valid for v10.0.1.
class namevalue {
{
"name1" { "value1" }
"name2" { "value1" }
}
}
I am getting a parsing error on b verify load.
012e0021:3: The requested attribute ({ name1) is invalid for 'class'.
So I tried this and it passed the verify.
class namevalue {
"name1" { "value1" }
"name2" { "value1" }
}
But, after I load and sync, the class changed to
class namevalue {
{
"value1"
"name1"
"value2"
"name2"
}
}
I want to make it easy to lookup values based on names.
Thanks!
6 Replies
Sort By
- L4L7_53191
Nimbostratus
On 10.1 this is what works for me:class foo { { "www.one.com www.foo.com" "www.two.com www.bar.com" } }
- qqdixf5_74186
Nimbostratus
This format works in v10.0.1 as well. But does it make the entry as name/value pairs so it it easy to lookup value based on the key?class namevalue { { "name1" { "value" } "name2" { "value" } } }
- Hamish
Cirrocumulus
Well the formatclass keyvalue { { "onekey" { "onevalue" } "twokey" { "twovalue" } } }
- qqdixf5_74186
Nimbostratus
I used GUI, created a string datagroup, added these two string entries:"name1" {"value1"} "name2" {"value2"}
class namevalues{ { "\"name1\" {\"value1\"}" "\"name2\" {\"value2\"}" } }
{"name1" {"value1"}} {"name2" {"value2"}}
- L4L7_53191
Nimbostratus
This rule works with the original format I posted above. The idea of the rule is to redirect based on a lookup of the original HTTP::host header value. For example,when HTTP_REQUEST { set Host [findclass [HTTP::host] dc-post " "] log local0. "Host var is $Host" if { $Host ne "" } { HTTP::redirect http://$Host[HTTP::uri] } }
- hoolio
Cirrostratus
I think qqdixf5 is using 10.0.x which might handle class -name and class -value differently than 10.1.x. I think in order to use class -name/-value in 10.0.x, you'd need to use the := format in an external datagroup.
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