cancel
Showing results for 
Search instead for 
Did you mean: 

Using iRules to route traffic using JSON data set

Andrew_Lagomarc
Nimbostratus
Nimbostratus

I've been asked by our developer team if we can route to a pool member based upon a JSON data set that will differ for cloud foundry vs websphere.  I am new to JSON, but I assume if the data set includes data set A route to websphere but if it has data set B route to cloud foundry.  

 

Has anyone seen this type of iRule?

4 REPLIES 4

See the links below as you need to capture the payload and then find the string and do maybe "if else" to send to different pools based on the payload.

 

https://support.f5.com/csp/article/K07535385

https://clouddocs.f5.com/api/irules/HTTP__payload.html

https://community.f5.com/t5/crowdsrc/simple-iruleslx-json-rewrite/ta-p/289095

 

Andrew_Lagomarc
Nimbostratus
Nimbostratus

I've been given some clarification on what they are asking.  They want me to inspect the JSON data set paramters and then if they match a certain set, then update them to a newer data set that includes slightly different parameters.  

I am not quite putting all those articles together can you help me understand the shell of what I would be required to write for this?

It sounds like the first reply you got from @Nikoolayy1 is closest to the solution you are looking for. And this post: https://community.f5.com/t5/crowdsrc/simple-iruleslx-json-rewrite/ta-p/289095 seems the best starting point, since you'll need to modify the JSON payload.

This solution makes use of iRulesLX. These videos are a good starting point to learn more about iRules and how to use them on your BIG-IP: https://www.youtube.com/watch?v=Gh3hfFHoj1w