Forum Discussion
hooleylist
Jan 03, 2012Cirrostratus
Force reload of external datagroup files?
How can I force a reload of external data group files via tmsh?
On 11.1, I've imported a data group file via the GUI under File Management | Data Group File List | Import. I then edited the file ...
hooleylist
Jan 04, 2012Cirrostratus
Here are the steps for future reference:Create a new external data group from the CLI non-interactively
1. Create or copy over to LTM a temporary file containing the external data group contents. If copying, make sure the line terminators are \n only not \r\n.
You can use od to view the unprintable characters in a file:
od -c /var/tmp/dos.file
0000000 " n a m e 1 " : = " v a l u
0000020 e 1 " , \r \n " n a m e 2 " : =
0000040 " v a l u e 2 " , \r \n " n a m
0000060 e 3 " : = " v a l u e 3 " ,
If the source file was created on Windows, it most likely has \r\n line terminators, so use tr to remove the \r's:
tr -d '\r' < /var/tmp/dos.file > /var/tmp/string_name_value_external_dg.txt
od -c /var/tmp/string_name_value_external_dg.txt
0000000 " n a m e 1 " : = " v a l u
0000020 e 1 " , \n " n a m e 2 " : =
0000040 " v a l u e 2 " , \n " n a m e 3
0000060 " : = " v a l u e 3 " ,
cat /var/tmp/string_name_value_external_dg.txt
"name1" := "value1",
"name2" := "value2",
"name3" := "value3",
2. Create the new external data group file
tmsh create /sys file data-group string_name_value_external_dg_file separator ":=" source-path file:/var/tmp/string_name_value_external_dg.txt type string
3. Create the external data group referencing the file
tmsh create /ltm data-group external string_name_value_external_dg external-file-name string_name_value_external_dg_file
4. Save the config from memory to file
tmsh save /sys config
----------------------------------------------------------------Modify the external data group file
1. Create a new temporary file containing the updated external data group contents
cat /var/tmp/string_name_value_external_v2_dg.txt
"name1" := "valueA",
"name2" := "valueB",
"name3" := "valueC",
2. Modify the system file to reference the new content. Note that the new existing system file content is overwritten with the new file content. A new system file is not created.
tmsh modify /sys file data-group string_name_value_external_dg_file source-path file:/var/tmp/string_name_value_external_v2_dg.txt
3. Save the config from memory to file
tmsh save /sys config
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