Forum Discussion
Find connection attempts via source IP
- Apr 20, 2020
when CLIENT_ACCEPTED { set LogString "Client [IP::client_addr]" log local0. "==== $LogString (request) =====" } when SERVER_CONNECTED { log local0. "==== $LogString (server connected) - server: [LB::server addr]:[LB::server port] ====" }
I have tested that this works
You should be able to just remove the HTTP calls from the rule I posted above like so and it should work:
when CLIENT_CONNECTED {
set LogString "Client [IP::client_addr]:[TCP::client_port]
log local0. "==== $LogString (request) ====="
}
when SERVER_CONNECTED {
log local0. "==== $LogString (server connected) - server: [LB::server addr]:[LB::server port] ===="
}
- TFlemingApr 17, 2020Nimbostratus
Sadly I still get an error "01071912:3: HTTP_REQUEST event in rule (/Common/LogLocalConnections) requires an associated HTTP or FASTHTTP profile on the virtual-server (/Common/RDS-2016-VIP)." with the above iRule.
- BeakerApr 18, 2020Cirrus
Sorry forgot to change the irule event when I edited it before. I have updated the code above. This does not use http processing events rather just tcp events
- TFlemingApr 20, 2020Nimbostratus
Good morning Beaker. New error. "01070151:3: Rule [/Common/LogLocalConnections] error: /Common/LogLocalConnections:1: error: [unknown event (CLIENT_CONNECTED)][when CLIENT_CONNECTED {
set LogString "Client [IP::client_addr]:[TCP::client_port]"
log local0. "==== $LogString (request) ====="
}]". The code I have is:
when CLIENT_CONNECTED { set LogString "Client [IP::client_addr]:[TCP::client_port]" log local0. "==== $LogString (request) =====" } when SERVER_CONNECTED { log local0. "==== $LogString (server connected) - server: [LB::server addr]:[LB::server port] ====" }
- BeakerApr 20, 2020Cirrus
when CLIENT_ACCEPTED { set LogString "Client [IP::client_addr]" log local0. "==== $LogString (request) =====" } when SERVER_CONNECTED { log local0. "==== $LogString (server connected) - server: [LB::server addr]:[LB::server port] ====" }
I have tested that this works
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