Forum Discussion
winston_85158
Oct 16, 2014Nimbostratus
Anyone using HSL with Graylog
Hi,
Is anyone using HSL in combination with Graylog (see http://www.graylog2.org/)? It is central logging server that is expecting UDP based messages in a JSON format (GELF).
I'm hoping fo...
Stanislas_Piro2
Aug 09, 2017Cumulonimbus
Hi,
Thank you for the example of GRAYLOG Json format.
I just configured request logging instead of irule with HSL with following parameters:
ltm profile request-log logging-GRAYLOG {
app-service none
defaults-from request-log
response-log-pool POOL-GRAYLOG
response-log-protocol mds-tcp
response-log-template "{\"version\": \"1.1\", \"host\":\"$Host\", \"short_message\":\"$HTTP_REQUEST\", \"level\":6, \"facility\":\"F5_access_log\", \"timestamp\": \"$TIME_UNIX\", \"_httpStatus\":\"$HTTP_STATUS\", \"_userAgent\":\"${user-Agent}\", \"_clientIp\":\"$CLIENT_IP\", \"_user\":\"$User\", \"_respBytes\":\"$RESPONSE_SIZE\", \"_elapsed\":\"$RESPONSE_MSECS\"}"
response-logging enabled
}
The log template is the following:
{"version": "1.1", "host":"$Host", "short_message":"$HTTP_REQUEST", "level":6, "facility":"F5_access_log", "timestamp": "$TIME_UNIX", "_httpStatus":"$HTTP_STATUS", "_userAgent":"${user-Agent}", "_clientIp":"$CLIENT_IP", "_user":"$User", "_respBytes":"$RESPONSE_SIZE", "_elapsed":"$RESPONSE_MSECS"}
User value is from following irule:
when CLIENT_ACCEPTED {
set APMusername ""
}
when ACCESS_ACL_ALLOWED {
if {$APMusername equals ""} {
set APMusername [ACCESS::session data get session.logon.last.username]
}
HTTP::header insert "USER" $APMusername
}
when HTTP_REQUEST_RELEASE {
catch {HTTP::header remove "USER"}
}
with this log template, I was able to parse JSON content and filter requests by key value.
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