Check this out:
https://devcentral.f5.com/articles/intermediate-irules-data-groups-20430
You need to take the contents of the file you imported and set it to the key/values in the datagroup.
ltm data-group internal my_datagroup {
records {
site1.mysite.com {
data 10.1.1.31
}
site2.mysite.com {
data 10.1.1.32
}
...
site130.mysite.com {
data 10.1.1.130
}
}
type string
}
Then you can do a single statement like:
if { [class match [string tolower [HTTP::host]] equals "my_datagroup" ] } {
node [class match -value [string tolower [HTTP::host]] equals "my_datagroup"
}
You could add the records in via the GUI or tmsh, or create the file like that and merge it in, or even add it to the bigip.conf and just to a tmsh load sys config.