Forum Discussion
hoolio
Cirrostratus
Jun 13, 2006Using PROFILE::httpclass to get HTTP class configuration info
Hello,
I'm trying to understand how to access HTTP class characteristics and then use a rule to select between a set of HTTP classes based on the filters of the classes.
I found in the profile_base.conf that you can determine whether App Security is enabled on an HTTP class in the context of HTTP_CLASS_SELECTED, using:
[PROFILE::httpclass [HTTP::class] ts_enabled]
So now I'm trying to determine how to access the other parameters of a specific HTTP class. If I have an HTTP class with the following configuration, how can I access the filters like hosts, paths, headers, etc?
profile httpclass asm_httpclass_01 {
defaults from httpclass
hosts "my_host"
paths "/class1"
headers "my_header"
cookies "my_cookie"
pool http_pool
asm enable
}
I tried a few guesses, but wasn't able to parse anything:
[PROFILE::httpclass [HTTP::class] ts_uri]
[PROFILE::httpclass [HTTP::class] ts_uris]
[PROFILE::httpclass [HTTP::class] uri]
[PROFILE::httpclass [HTTP::class] uris]
The wiki page for PROFILE doesn't show examples. And the new iRule editor (while very handy) doesn't have any auto-complete info for this.
And while we're at it, could you also detail what options there are for HTTP::class? I believe you can set the HTTP class using:
HTTP::class my_class
but are there other options as well?
Thanks,
Aaron
- hoolio
Cirrostratus
So I was thinking about this further and realized it might be more appropriate to ignore the filters of the HTTP class and include the logic of which HTTP class to direct a request within the rule itself. - From the documentation for the HTTP::class command (Click here) it seems that the HTTP::class command is read-only and returns the name of the HTTP::class associated with the given context. I don't currently see a way to query the class configuration data.
- Doh, I should have read your first post first... I'll look into what the valid arguments are for the PROFILE::httpclass command and let you know.
- unRuleY_95363Historic F5 AccountThe PROFILE:: commands only operate on the current profile. So, I would assume that it would return the value of any specified attribute of the currently selected HTTP class. Basically, leave out the HTTP class profile name in your example.
- hoolio
Cirrostratus
Thanks for the information. - unRuleY_95363Historic F5 AccountYou don't need to actually select a class to make this work. If you look at the _ASM_clientside rule, all you really need to do is replicate the code that happens in the HTTP_CLASS_SELECTED event.
- hoolio
Cirrostratus
Great. Thanks for the tips. I'll test it out.
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