Forum Discussion
saks-devnull_34
Nimbostratus
May 14, 2018Parsing string Data-Groups with Arrays as value?
Hello, I was hoping someone can share some working examples or help point me in the right direction regarding a string data-group with an array as a value.
String Data-Group:
key = record1 and value = ["name": "value", "meta": "value", "proto": "value"]
key = record2 and value = ["name": "value", "meta": "value", "proto": "value"]
key = record3…
I need to then reference the data-group in a TCL iRule to lookup what is the value of record2.meta. Similar to objectName.property in Javascript but the property is always a string.
I was attempting to use a combination of
[class match]
or [array]
commands to access the array data, but failed to do so.
Thanks
- Stanislas_Piro2
Cumulonimbus
Hi,
You can create a list
key = record1 and value = {"name" "value" "meta" "value" "proto" "value"} key = record2 and value = {"name" "value" "meta" "value" "proto" "value"}
Then, in the irule, convert the list to array
array set myarray [class match -value $key equals "mykey"]
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