Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

How to extract or upload a Data Group through CLI.

kaoutar
Cirrus
Cirrus

Hello All,

Could you please help me to find a way to extract or upload a Data Group through CLI, In fact i need to add 300 IP Addresses which is tough manually.

thank you

1 ACCEPTED SOLUTION

Paulius
MVP
MVP

@kaoutarYou should be able to use the following steps to work it out.

1. In the GUI create a sample data-group with 2-3 entries.
2. In the CLI at tmsh run "list sys file data-group <your_data_group_name>" and grab that output from the beginning of the output to the end.
3. Next go to a text editor and paste in all your entries following the exact formatting of the sample data-group that you created.
4. Log into the CLI and at tmsh run "load sys config from-terminal merge" and then paste in the entirety of your data-group and after the text is pasted press ctrl+d twice which will merge your data-group into the existing sample data-group.

It is extremely important to use the exact command for "load sys config from-terminal merge" otherwise you could mess up your F5 configuration.


5. Issue a "save sys config" to ensure that the configuration is saved.

After these steps you should be able to go into the GUI or CLI and validate that the data-group was created properly.

View solution in original post

3 REPLIES 3

Hello,

you can check the below article for creating data group from external file. "external data groups are better suited for large data sets"

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

Thanks,

Paulius
MVP
MVP

@kaoutarYou should be able to use the following steps to work it out.

1. In the GUI create a sample data-group with 2-3 entries.
2. In the CLI at tmsh run "list sys file data-group <your_data_group_name>" and grab that output from the beginning of the output to the end.
3. Next go to a text editor and paste in all your entries following the exact formatting of the sample data-group that you created.
4. Log into the CLI and at tmsh run "load sys config from-terminal merge" and then paste in the entirety of your data-group and after the text is pasted press ctrl+d twice which will merge your data-group into the existing sample data-group.

It is extremely important to use the exact command for "load sys config from-terminal merge" otherwise you could mess up your F5 configuration.


5. Issue a "save sys config" to ensure that the configuration is saved.

After these steps you should be able to go into the GUI or CLI and validate that the data-group was created properly.

Thank you so much for your reply