Forum Discussion
iRule data group
Hi
We have some iRule data groups need to be updated regularly and the iRule will forward the traffic to different servers base on them. In order to minimize the work load, are there any ways we can update the data group quickly, say we have a excel/xml IP list file which exported from monitoring system, can we import it to F5 data group configuration? Any other ideas?
Thanks.
5 Replies
- Stuart_Mao_5257
Nimbostratus
Joe wrote an article on the File Transfer APIs that shows how to use the file upload/download APIs in the System.ConfigSync interface.
iControl 101 - 06 - File Transfer APIs
- xzjleo_133138
Nimbostratus
Hi Stuart, We don't have iControl, any other work around? Thanks. - Stuart_Mao_5257
Nimbostratus
iControl comes free, or you can use scp to upload your data
- Kevin_Stewart
Employee
Updating a data group is relatively straight forward. The hard part I think is going to be the conversion process. There's no tool that I'm aware of to convert from Excel spreadsheet or flat XML file to data group format. Is it simply a single list of IP addresses, different lists of IP addresses, or is it a list of key-value pairs?
- Kevin_Stewart
Employee
I don't think SNMP is the way to go. In lieu of iControl (probably the best way), you could partially automate the process by first uploading the flat list of IP addresses. Example:
10.70.0.1/32 10.70.0.2/32 10.70.0.3/32 10.70.0.4/32 10.70.0.5/32 10.70.0.6/32 10.70.0.7/32 10.70.0.8/32 10.70.0.9/32And then processing this file with a simple Bash script:
!/bin/bash data_group=dgimport_ip_list import_file=iplist import the first line and replace everything in the data group line=`head -1 $import_file` tmsh modify ltm data-group internal $data_group records replace-all-with { $line } parse the rest of the file and add the data to the data group sed 1d $import_file |while read line do tmsh modify ltm data-group internal $data_group records add { $line } doneMake sure the address-based data group has been created first.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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