Forum Discussion

wayne_li_113376's avatar
wayne_li_113376
Icon for Nimbostratus rankNimbostratus
Jan 08, 2006

how to write a data to external calss

hi

 

i have a question.I created a class used a external file and

 

the application need output the record to this class.

 

how to do like this? my rules didn't realize the data output the external file.

 

my rules following:

 

the external class is my_test

 

ingress:

 

when CLIENT_ACCEPTED {

 

log local0.[IP::remote_addr]

 

log local0.[LINK::lasthop]

 

set ::my_test "[IP::remote_addr];[LINK::lasthop]"

 

lappend $::my_test

 

log local0.$::my_test

 

}

 

outgress:

 

 

when CLIENT_ACCEPTED {

 

log local0. [IP::local_addr]

 

log local0.$::my_test

 

switch [findclass [IP::local_addr] $::my_test ";"] {

 

 

00:14:6a:b9:19:1b {pool test

 

 

log local0. "test"}

 

 

00:0d:29:71:16:31 {pool test1

 

 

log local0. "test1"}

 

 

default {pool test

 

log local0. "defaul pool"

 

}

 

}

1 Reply

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    The iRules language does not currently have any way of modifying the filesystem on the BIG-IP. This means that any class, in an external file or in the main config, will not be permanently modified when it is modified in a rule. The changes will remain in memory until the system's configuration is reloaded, at which time the information that was in the configuration files will be re-loaded into memory.

     

     

    The only way to have the information in memory become permanent is to save it to disk by way of the bigpipe save command, which can be executed via iControl if you require programatic access to this command.

     

     

    HTH,

     

    -Colin