Applies To:
Show Versions
BIG-IP AAM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP APM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP GTM
- 11.6.3, 11.6.2, 11.6.1
BIG-IP Link Controller
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP Analytics
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP LTM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP PEM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP AFM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
BIG-IP DNS
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0
BIG-IP ASM
- 14.0.1, 14.0.0, 13.1.5, 13.1.4, 13.1.3, 13.1.1, 13.1.0, 13.0.1, 13.0.0, 12.1.6, 12.1.5, 12.1.3, 12.1.2, 12.1.1, 12.1.0, 11.6.3, 11.6.2, 11.6.1
About file import for iRules
If you want to write an iRule that references a file that resides on another system, you must first import the file to the BIG-IP system. You can then convert the file to an iFile that an iRule can reference.
Importing a file for an iRule
About iFiles
Using the BIG-IP Configuration utility, you can create a special file called an iFile. An iFile is a file that is based on an external file that you previously imported to the BIG-IP system from another system. You can reference an iFile from within an iRule, based on a specific iRule event.
To create an iFile and use it within an iRule, you start from the Local Traffic option on the Main tab.
Viewing a list of iFiles
- On the Main tab, click .
- In the Name column, view the list of iFiles that you peviously created on the BIG-IP system.
Creating an iFile
iRule commands for referencing an iFile
With these iRule commands, you can reference the new iFile from within an iRule:
- [ifile get IFILENAME]
- [ifile listall]
- [ifile attributes IFILENAME]
- [ifile size IFILENAME]
- [ifile last_updated_by IFILENAME]
- [ifile last_update_time IFILENAME]
- [ifile revision IFILENAME]
- [ifile checksum IFILENAME]
- array set [file attributes IFILENAME]
This sample iRule shows some of these commands:
ltm rule ifile_rule { when HTTP_RESPONSE { # return a list of iFiles in all partitions set listifiles [ifile listall] log local0. "list of ifiles: $listifiles" # return the attributes of an iFile specified array set array_attributes [ifile attributes "/Common/ifileURL"] foreach {array attr} [array get array_attributes ] { log local0. "$array : $attr" } # serve an iFile when http status is 404. set file [ifile get "Common/ifileURL"] log local0. "file: $ifile" if { [HTTP::status] equals "404" } { HTTP::respond 200 ifile "/Common/ifileURL" } } }