Forum Discussion

Andrea_Arquint's avatar
Andrea_Arquint
Icon for Nimbostratus rankNimbostratus
Apr 23, 2013

how to change a string in a datagroup

Hi,

 

I just want to change a string in a specific datagroup via simple GET request to the dedicated virtual server.

 

So, I know how to do "findstring" in URL. This is not the case.

 

 

The case is to replace a specific string in a datagroup.

 

 

The story behind is that I want to activate or deactivate a maintenance page which is hosted via iFile on the bigip itself

 

and controled via a iRule which is assigned to a virtual server.

 

 

Does somebody have any code example about such case?

 

 

Many thanx

 

bb

 

2 Replies

  • it might be possible but tricky. anyway, i think the correct way is to use powershell or icontrol.

     

     

    modifying data group with PowerShell

     

    https://devcentral.f5.com/community/group/aft/1184912/asg/51
  • The important thing to understand is that you cannot modify a data group directly from an iRule. There are ways around this if course, but for the sake of complexity and supportability I won't get into that. It's also not considered a safe thing to do (touching the control plane from the data plane) unless you can absolutely guarantee the security and throughput of that "bridge". That said, there are a few options you may want to consider.

     

     

    1. Access the data group via out-of-band process. Use iControl or SSH and TMSH commands to the management shell to modify the data group.

     

    2. Move your data group information to a global table. On initialization, consume the static data group (default) data into a table and read and write to that instead.

     

    3. Use syslog to fire an action (TMSH call) in the shell on a log event. This is one of those "bridge" methods I mentioned earlier and would not be my first choice for all of the reasons already given, but just throwing it out there as an example of flexibility.

     

     

    If these I think option 2 is my favorite, but still comes with the caveat that you must guarantee the security of the function. You don't want anyone to be able to turn on maintenance mode.