Forum Discussion
Hamish
Cirrocumulus
Dec 15, 2009find_string_class_member clarification needed...
Hi.
Does anyone know what find_class_string_member actually compares? Is it the whole string? Or just the portion up to the default field separator (' ')?
Given an (External) string class of (Ignore the syntax I know it's not correct, it's the strings that are important)
class mystrings {
"one.html text/html "
"two.html text/html "
}
Where gobbledegook is the base64 encoded contents of the files...
I (almost?) always seem to get a not-found (false) back from find_class_string_member when just searching for the string 'one.html'.
Which means that a subsequent add_string_class_member() will fail with it's usual helpful message that seems to indicate it already exists.
Is there a flag I'm missing to tell it how to do the search? Or is it dependent on something else? The docs seem pretty light in the iControl SDK on this. I'd be willing to accept you need the WHOLE string to match, But the interface isn't very clear to me whether strings need to be specified in their entirety, or if the match is link findclass in an iRule.
If you have to specify the whole string, then how is modify_string_class() supposed to work. It's got to be matching something, but there's no explicit key/value specified (Unless it's implied by the ' ' delimiter in the string).
If it does match a substring, then I have to ask why it fails... Docs either way would be appreciated....
TIA
Hamish.
- The code does an exact string match. I have no clue on why you may be getting a positive result on a partial match. The logic in the code is as follows:
Loop over the searches (the class_members array) Loop over the class_members[ i ].members array Loop over the entries in the class if the class entry equals the search term, break and return true.
- Hamish
Cirrocumulus
That's OK. I think I'll try a different approach.
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