I forward CEF only transaction log (access.log).
Since Apache version 2.4 Error.log also can be customized with CEF - I'll try to update that soon.
access log with CEF works file on Apache 1.X and 2.X
Log format definitions
HTTP
LogFormat "CEF:0|Apache|apache||%>s|%m %U%q|Unknown|end=%{%b %d %Y %H:%M:%S}t app=HTTP cs2=%H suser=%u shost=%h src=%a dhost=%V dpt=%p dproc=apache request=%U requestMethod=%m fname=%f cs1Label=Virtual Host cs1=%v cn1Label=Responce Time cn1=%T out=%B cs4Label=Referer cs4=%{Referer}i dvchost=%v dvc=%A deviceProcessName=apache_access_log requestClientApplication=%{User-Agent}i acs3Label=X-Forwarser-For cs3=%{X-Forwarded-For}i" CEF_HTTP
Sample output:
CEF:0|Apache|apache||200|GET /index.html|Unknown|end=Nov 07 2014 01:19:42 app=HTTPS cs2=HTTP/1.1 suser=- shost=192.168.0.26 src=192.168.0.26 dhost=www.pheo.net dpt=443 dproc=apache request=/index.html requestMethod=GET fname=/full/path/index.html cs1Label=Virtual Host cs1=toth.pheo.net cn1Label=Responce Time cn1=0 out=3479 cs4Label=Referer cs4=- cs5Label=SSL Protocol cs5=TLSv1.2 cs6Label=SSL CIPHER cs6=ECDHE-RSA-AES128-GCM-SHA256 dvchost=toth.pheo.net dvc=192.168.0.26 deviceProcessName=apache_access_log requestClientApplication=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 cs3Label=X-Forwarser-For cs3=-
HTTPS
LogFormat "CEF:0|Apache|apache||%>s|%m %U%q|Unknown|end=%{%b %d %Y %H:%M:%S}t app=HTTPS cs2=%H suser=%u shost=%h src=%a dhost=%V dpt=%p dproc=apache request=%U requestMethod=%m fname=%f cs1Label=Virtual Host cs1=%v cn1Label=Responce Time cn1=%T out=%B cs4Label=Referer cs4=%{Referer}i cs5Label=SSL Protocol cs5=%{SSL_PROTOCOL}x cs6Label=SSL CIPHER cs6=%{SSL_CIPHER}x dvchost=%v dvc=%A deviceProcessName=apache_access_log requestClientApplication=%{User-Agent}i cs3Label=X-Forwarser-For cs3=%{X-Forwarded-For}i" CEF_HTTPS
Sample output:
CEF:0|Apache|apache||200|GET /index.html|Unknown|end=Nov 07 2014 01:19:42 app=HTTPS cs2=HTTP/1.1 suser=- shost=192.168.0.26 src=192.168.0.26 dhost=www.pheo.net dpt=443 dproc=apache request=/index.html requestMethod=GET fname=/full/path/index.html cs1Label=Virtual Host cs1=toth.pheo.net cn1Label=Responce Time cn1=0 out=3479 cs4Label=Referer cs4=- cs5Label=SSL Protocol cs5=TLSv1.2 cs6Label=SSL CIPHER cs6=ECDHE-RSA-AES128-GCM-SHA256 dvchost=toth.pheo.net dvc=192.168.0.26 deviceProcessName=apache_access_log requestClientApplication=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 cs3Label=X-Forwarser-For cs3=-
Definition of log:
HTTP
CustomLog "CEF.log" CEF_HTTP
HTTPS
CustomLog "CEF.log" CEF_HTTPS
I use syslog-ng for read and forward file,
Mappings table with sample data.
Description source: mod_log_config - Apache HTTP Server Version 2.4
Â
CEF COLUMN NAME | PARAMTER | HTTP | HTTPS | DESCRIPTION | VALUE | |
---|---|---|---|---|---|---|
HEADER | CEF:Version | CEF:0 | X | X | CEF:0 | |
Device Vendor | Apache | X | X | Apache | ||
Device Product | apache | X | X | apache | ||
Device Version | X | X | ||||
Signature ID | %>s | X | X | Status. For requests that got internally redirected, this is the status of the *original* request --- %>s for the last. | 200 | |
Name | %m %U%q | X | X | %m - The request method %U - The URL path requested, not including any query string. %q - The query string (prepended with a ? if a query string exists, otherwise an empty string) | GET /index.html | |
Severity | Unknown | X | X | Unknown | ||
BODY | end | %{%b %d %Y %H:%M:%S}t | X | X | Time in format: MMM dd YY HH:mm:ss | Oct 18 2014 20:37:09 |
app | HTTP/HTTPS | X | X | HTTP | ||
cs2 | %H | X | X | The request protocol | HTTP/1.1 | |
suser | %u | X | X | Remote user (from auth; may be bogus if return status (%s) is 401) | - | |
shost | %h | X | X | Remote host | 213.238.127.224 | |
src | %a | X | X | Remote IP-address | 213.238.127.224 | |
dhost | %V | X | X | The server name according to the UseCanonicalName setting. | www.pheo.net | |
dpt | %p | X | X | The canonical port of the server serving the request | 443 | |
dproc | apache | X | X | apache | ||
request | %U | X | X | The URL path requested, not including any query string. | / | |
requestMethod | %m | X | X | The request method | GET | |
fname | %f | X | X | Filename | /full/path/index.html | |
cs1Label | Virtual Host | X | X | Virtual Host | ||
cs1 | %v | X | X | The canonical ServerName of the server serving the request. | www.pheo.net | |
cn1Label | Responce Time | X | X | Responce Time | ||
cn1 | %T | X | X | The time taken to serve the request, in seconds. | 1 | |
out | %B | X | X | Size of response in bytes, excluding HTTP headers. | 3143 | |
cs4Label | Referer | X | X | Referer | ||
cs4 | %{Referer}i | X | X | - | ||
dvchost | %v | X | X | The canonical ServerName of the server serving the request. | www.pheo.net | |
dvc | %A | X | X | Local IP-address | 192.168.0.26 | |
cs5Label | SSL Protocol | X | SSL Protocol | |||
cs5 | %{SSL_PROTOCOL}x | X | TLSv1.2 | |||
cs6Label | SSL CIPHER | X | SSL CIPHER | |||
cs6 | %{SSL_CIPHER}x | X | ECDHE-RSA-AES128-GCM-SHA256 | |||
deviceProcessName | apache_access_log | X | X | apache_access_log | ||
requestClientApplication | %{User-Agent}i | X | X | Mozilla/5.0 (compatible; Googlebot/2.1; http://www.google.com/bot.html) | ||
cs3Label | X-Forwarser-For | X | X | X-Forwarser-For | ||
cs3 | %{X-Forwarded-For}i | X | X | 10.11.1.241 |