Forum Discussion
Tracy_Butler_90
Nimbostratus
Jul 06, 2006writing an irule to log all traffic
Need assistance with writing an irule to log all traffic flow. Support suggested that this should be done versus making changes to the syslog-ng file. I've tried making changes to syslog-ng file wit...
nitass
Employee
Oct 18, 2011[root@iris:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.17.33:http
ip protocol tcp
rules myrule
}
[root@iris:Active] config b rule myrule list
rule myrule {
when CLIENT_ACCEPTED {
log local0. "[IP::client_addr]:[TCP::client_port]"
}
}
[root@iris:Active] config b syslog include
SYSLOG - Include Data:
filter f_local0 {
facility(local0) and
not match("myrule");
};
log {
source(s_syslog_pipe);
filter(f_local0);
filter(f_no_audit);
destination(d_ltm);
};
filter f_myrule {
match("myrule");
};
destination d_myrule {
file("/var/log/myrule" create_dirs(yes));
};
log {
source(s_syslog_pipe);
filter(f_myrule);
destination(d_myrule);
};
[root@iris:Active] config cat /var/log/ltm
[root@iris:Active] config cat /var/log/myrule
Oct 18 22:19:40 local/tmm info tmm[4601]: Rule myrule : 192.168.206.102:53447
Oct 18 22:19:42 local/tmm info tmm[4601]: Rule myrule : 192.168.206.102:53449
Oct 18 22:19:45 local/tmm info tmm[4601]: Rule myrule : 192.168.206.102:53450
Oct 18 22:20:10 local/iris notice b[28110]: 012e0045:5: AUDIT - user root - rule myrule list
hope this helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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