APM parse HTTP Connector json to message box, iRule etc.
Hello all,
I have configured per-session and per-request policies on my APM (APM+LTM) mode and in the process of authentication I want to get some data from external web server. Data is in JSON format. To do that I have created HTTP Connector, assigned it to my per-request policy via subroutine and i can see that the subsession variables are beeing populated correctly via the HTTP Connector (with option save data, i can parse it but the result is the same, just more variables - one per JSON field). In the Overview:Active Session i can see subsession with the following variable with my data:
879cb369./Common/HTTPConnector/XXXXXXXXXXX==.nvp_block.subsession.http_connector.body
Now I wanted to get this data and use it in my authentication flow and iRule but it doesn't work.
First I wanted to test it, by assiginig variable and showing a simple message box in PerReq-policy:
And after that the massage box with: %{perflow.custom} - it doesnt work.
Also tried to just show it in logs with iRule like in documentation ltm rule command ACCESS perflow (f5.com)
So i created an iRule agent in per-request-policy pointing to bellow iRule and attached iRule to my VS:
when ACCESS_PER_REQUEST_AGENT_EVENT {
set $body [ACCESS::perflow get subsession.http_connector.body]
log local0. $body
}
But it doesnt show anything.
I have few questions:
- Is it even possible to access variables in subsession that got retrieved via HTTPConnector and use it further? For example to build JWT for auth?
- Can I assign more than two custom variables from subsession? according to this guide i can only use perflow.custom and perflow.scratchpad?:
Using Variable Assign to populate gating criteria,Using Variable Assign to populate gating criteria,Using Variable Assign to populate gating criteria (f5.com)
Using Variable Assign to populate a perflow variable other than perflow.custom and perflow.scratchpad causes subroutine results to become unreliable.
3. Maybe there is an other option to achieve my goal?