Forum Discussion
Trouble with iFiles
I'm trying to use iFiles to serve up some static text pages via an iRule. I have created two iFiles, which I can see via TMSH:
(tmos) list sys file ifile
sys file ifile F5_logo_jpg {
checksum SHA1:64327:fde13ec9533c3e33a0615d3967a1462b3603e80e
create-time 2013-03-29:09:41:41
created-by root
last-update-time 2013-03-29:09:41:41
mode 33188
revision 1
size 64327
updated-by root
}
sys file ifile access_denied_txt {
checksum SHA1:2338:bda199eb900ca98058da8582d3018ca38bd9842d
create-time 2013-03-28:14:19:40
created-by root
last-update-time 2013-03-28:14:19:40
mode 33188
revision 1
size 2338
updated-by root
}
I then created a virtual server to serve up a file, using this simple iRule:
when HTTP_REQUEST {
HTTP::respond 200 content [ifile get /Common/access_denied_txt]
log local0. "iFiles: [ifile listall]"
}
When I try to save it, I get:
01070151:3: Rule [/Common/ifile_test] error: Unable to find ifile (/Common/access_denied_txt) referenced at line 2: [ifile get /Common/access_denied_txt]
Commenting out the HTTP respond gives me this in the 'ltm' log file:
Rule /Common/ifile_test : iFiles:
So..... How do I access the iFiles via an iRule? It appears as though the iRule can't see the iFiles whatsoever. I'm running v11.3.0 HF4.
Ideas??
Thanks!
Richard
4 Replies
- Richard_Jones
Nimbostratus
I have tested this all the way down to v11.1, and I get the same results. I've even tested the iRule listed in the wiki under iFiles:
https://devcentral.f5.com/wiki/irules.iFile.ashx
I've only tested on a VM, and I've never come across anything that works differently on a VM as opposed to a physical, but I'm running out of ideas.
- Kevin_Stewart
Employee
After you import the file (System | File Management | iFile List), you must then import it into iRules iFiles list (Local Traffic | iRules | iFiles List). Your imported iFile will show up in the File Name drop down box. Your iRule would then reference the name used in the iRules iFiles List. - Richard_Jones
Nimbostratus
Awesome, thank you! I somehow missed that...
- Shekhar_Goyal_1
Nimbostratus
Thanks it worked
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
