Forum Discussion

adam_webb's avatar
Icon for Nimbostratus rankNimbostratus
Mar 20, 2023

Can I write a key-value pair to a datagroup from an iRule?

Can I write a key-value pair to a datagroup from an iRule? They key and value will never change, though there will be more and more k/v pairs added over time, or maybe even removed. But for the purpose of my iRule, I just want to add one key-value pair at a time from within an iRule. 



2 Replies

  • adam_webb By key do you mean SSL key? You can store almost any string in each field in a data-group and then use an iRule to match one value to the other.

  • adam_webb, Three options off the top of my head...though 1. comes with a  "just because you can doesn't mean you should" warning label. 2. is probably the best path.

    1. Call the iControl REST API from a sideband connection
    2. Use ISTATS::set to push the key/value to an iCall script. The key would be set as part of the iStats key (it's a little complex to grok) and the value would just be the value. Example in this article I wrote on invalidating WA cache.
    3. Push an entry to a local log file (like local0. that goes to /var/log/ltm) and create an alert in user_alert.conf that an iCall trigger can capture and act on. Example on an APM threshold crossing.