Apache Httpd (Ver 2.4)
Background
Apache HTTPD Log Analysis App is an Http server for Windows and Unix machines that automatically Collect - Read - Parse - Analyzes - Reports all machine generated log data of the server and presents a comprehensive automatic predefined set of Reports, Dashboards and Gadgets. Once you Setup and configure the Apache HTTPD App, you will be redirected to the dashboards where yuo will have graphs about: errors occured, geographic data of users and requests, Browsers related analytics, Pages and hits analysis, resources and many statistics about your servers' performance. You later use XpoLog built in Analytics features to zero in on errors and take actions to improve your system's uptime. Apache HTTP server logs data can be viewed, filtered and searched via the main XpoLog console.
Steps
Â
- Add Log Data In XpoLog, When adding a log to XpoLog you can now select the Log Type (logtype) for Apache Httpd the are the following logtypes:
- httpd
- w3c
- webserver
i. in addition select not only httpd but also the log type - access or error
- Once all required information is set click next and edit the log pattern, this step is crucial to the accuracy and deployment of the Apache Httpd App. Use the following conversion table to build the XpoLog pattern out of the access log format.
Â
Example
In the Apache Httpd configuration file, usually httpd.conf by default, located under the conf/ directory (Linux "/etc/httpd/conf") search for the LogFormat directive:
LogFormat "%h %l %u %t \"%r\" %>s %b" common
In XpoLog such pattern will be translated into:
{text:RemoteHost,ftype=remotehost;,} {text:RemoteLog,ftype=remotelog;,} {text:User,ftype=remoteuser;,} [{date:Date,locale=en;,dd/MMM/yyyy:HH:mm:ss z}] "{choice:Method,ftype=reqmethod;,GET;POST} {string:URL,ftype=requrl;,}{block,start,emptiness=true}?{string:Query,ftype=querystring;,}{block,end,emptiness=true} {string:reqprotocol,ftype=reqprotocol;,}" {number:ResponseStatus,ftype=respstatus;,} {text:Bytes Sent,ftype=bytesent;,}{eoe}
Â
for more information see below:
Apache Https Access Log Format Conversion Table
logtypes should be set to:Â httpd,w3c,webserver,access
Format String | Description | XpoLog Pattern | XpoLog ftype | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
%a | Remote IP-address of the request | {text:RemoteIP,ftype=remoteip} | remoteip | ||||||||||||
%{c}a | Underlying peer IP address of the connection | {text:RemoteIP,ftype=remoteip} | remoteip | ||||||||||||
| Local IP-address | {ip:LocalIP,ftype=localip} | localip | ||||||||||||
| Size of response in bytes, excluding HTTP headers. | {number:BytesSent,ftype=bytesent} | bytesent | ||||||||||||
| Size of response in bytes, excluding HTTP headers. In CLF format, i.e. a ' | {text:BytesSent,ftype=bytesent} | bytesent | ||||||||||||
| The contents of cookie FOOBAR in the request sent to the server. Only version 0 cookies are fully supported. | {string:Cookie_< FOOBAR >} Replace < FOOBAR > with cookie name |  | ||||||||||||
| The time taken to serve the request, in microseconds. | {number:ResponseTimeMilliSecs} | Â | ||||||||||||
| The contents of the environment variable FOOBAR | {string:EnvVariable_< FOOBAR >} Replace < FOOBAR > with variable name |  | ||||||||||||
| Filename | {text:FileName} Â | Â | ||||||||||||
| Remote host | {text:Remotehost,ftype=remotehost} Â | remotehost | ||||||||||||
| The request protocol | {text:RequestProtocol,ftype=reqprotocol} Â | reqprotocol | ||||||||||||
| The contents of FOOBAR If you're interested in what the request header was prior to when most modules would have modified it, use | {text:<FOOBAR>} https://en.wikipedia.org/wiki/List_of_HTTP_header_fields and so on it goes for the different headers.  |  | ||||||||||||
| Â | {text:Referer,ftype=referer} Â | referer | ||||||||||||
| Â | {text:User-agent,ftype=useragent} Â | useragent | ||||||||||||
%{ X-Forwarded-For}i | Â | {text:X-Forwarded-For,ftype=forwardforip} OR {ip:X-Forwarded-For,ftype=forwardforip} Â | forwardforip | ||||||||||||
| Number of keepalive requests handled on this connection. Interesting if means the first keepalive request after the initial one, '2' the second, etc...; otherwise this is always 0 (indicating the initial request). | {number:KeepAlive} |  | ||||||||||||
| Remote logname (from identd, if supplied). This will return a dash unless | {text:RemoteLog,ftype=remotelog} |  remotelog | ||||||||||||
%L | The request log ID from the error log (or '-' if nothing has been logged to the error log for this request). Look for the matching error log line to see what request caused what error | {text:logId,ftype=logid} | logid | ||||||||||||
| The request method | {text:RequestMethod,ftype=reqmethod} | reqmethod | ||||||||||||
| The contents of note FOOBAR from another module. | {string:<FOOBAR>}  |  | ||||||||||||
| The contents of FOOBAR | {string:<FOOBAR>}  |  | ||||||||||||
| The canonical port of the server serving the request | {number:ServerPort,ftype=serverport} | serverport | ||||||||||||
| The canonical port of the server serving the request or the server's actual port or the client's actual port. Valid formats areÂ
| {number:ServerPort,ftype=serverport} {number:LocalServerPort,ftype=localserverport} {number:RemotePort,ftype=remoteport} | serverport localserverportt remoteport | ||||||||||||
| The process ID of the child that serviced the request. | {text:ProcessID,ftype=processid} | processid | ||||||||||||
| The process ID or thread id of the child that serviced the request. Valid formats are | {text:ProcessID,ftype=processid} Valid formats are | processid | ||||||||||||
| The query string (prepended with a | {text:QueryString,ftype=querystring} OR Suggest a regexp that will build a list of parameters as cloumns. The query string (prepended with a | querystring | ||||||||||||
| First line of request |
| reqmethod requrl querystring reqprotocol | ||||||||||||
| The handler generating the response (if any). | {text:ResponseHandler} Â | Â | ||||||||||||
| Status. For requests that got internally redirected, this is the status of the *original* request --- | {number:ResponseStatus,ftype=respstatus} . For requests that got internally redirected, this is the status of the *original* request --- %>s for the last. | respstatus | ||||||||||||
| Time the request was received (standard english format) | {date:Date,locale=en,dd/MMM/yyyy:HH:mm:ss z} Â | Â | ||||||||||||
%{ format}t | The time, in the form given by format, which should be in an extended the time is taken at the beginning of the request processing. If it starts with processing. In addition to the formats supported byÂ
These tokens can not be combined with each other or The extended | {date:Date,locale=en,dd/MMM/yyyy:HH:mm:ss z} sec number of seconds since the Epoch |  | ||||||||||||
| The time taken to serve the request, in seconds. | {number:ResponseTimeSecs,,ftype=processrequestmilli} Â | processrequestmilli | ||||||||||||
| The time taken to serve the request, in a time unit given by same result as |
| processrequestmilli processrequestmicrosecs processrequestsecs | ||||||||||||
| Remote user (from auth; may be bogus if return status ( | {text:User,ftype=remoteuser} Remote user (from auth; may be bogus if return status ( | remoteuser | ||||||||||||
| The URL path requested, not including any query string | {text:RequestURL,ftype=requrl} The URL path requested, not including any query string. | requrl | ||||||||||||
| The canonical | {text:ServerName,ftype=servername} | servername | ||||||||||||
| The server name according to the | {text:ServerName,ftype=servername} The server name according to the UseCanonicalName setting. | servername | ||||||||||||
| Connection status when response is completed:
(This directive was | {text:ConnectionStatus} Connection status when response is completed:
(This directive was |  | ||||||||||||
%I | Bytes received, including request and headers. Cannot be zero. You need to enable mod_logio  to use this. | {number:TotalBytesWHeadersReceived,ftype=reqbyteswheaders} (with headers) | reqbyteswheaders | ||||||||||||
%O | Bytes sent, including headers. May be zero in rare cases such as when a request is aborted before a response is sent. You need to enable mod_logio  to use this. | {number:TotalBytesWHeadersSent,ftype=respbyteswheaders} (with headers – can help compute header size) | respbyteswheaders | ||||||||||||
%S | Bytes transferred (received and sent), including request and headers, cannot be zero. This is the combination of %I and %O. You need to enable mod_logio  to use this. | {number:TotalBytesWHeadersReceived,ftype=reqbyteswheaders} {number:TotalBytesWHeadersSent,ftype=respbyteswheaders} | reqbyteswheaders respbyteswheaders | ||||||||||||
| The contents of FOOBAR | {text:Req_<FOOBAR>} The content of FOOBAR: trailer line(s) in the request sent to the server. |  | ||||||||||||
| The contents of FOOBAR | {text:Resp_<FOOBAR>} The contents of FOOBAR |  |
Error Log
In the Apache Httpd configuration file, usually httpd.conf by default, located under the conf/ directory (Linux "/etc/httpd/conf") search for the LogFormat directive:
ErrorLogFormat "[%{u}t] [%m:%l] [pid %P:tid %T] %F: %E: %M"
In XpoLog such pattern will be translated into:
[{date:Date,locale=en,EEE MMM dd HH:mm:ss.SSSSSS yyyy}] [{text:Module}:{priority:Level,ftype=status;,}] [pid {text:ProcessID,ftype=processid;,}:tid {text:ThreadId,ftype=threadid;,}]{text:ErrorCode,ftype=errorcode;,}:{block,start,emptiness=true} {text:SourceFileName}:{block,end,emptiness=true} {string:Message,ftype=Message;,}
for more information see below:
Apache Https Error Log Format Conversion Table
logtypes should be set to: httpd,w3c,webserver,error
Format String | Description | XpoLog Pattern | XpoLog ftype |
%a | Client IP address | {ip:ClientIP,ftype=remoteip} | remoteip |
 | The port making the request | {text:ClientPort,ftype=port} | port |
%{c}a | Underlying peer IP address and port of the connection (see the mod_remoteip  module) | T.B.D |  |
| Local IP-address | {ip:LocalIP,ftype=localip} | localip |
 | The local port | {text:LocalPort,ftype=port} | localport |
%{name}e | Request environment variable name | T.B.D |  |
%E | APR/OS error status code and string | {text:ErrorCode,ftype=errorcode} | errorcode |
%F | Source file name and line number of the log call | {text:SourceFileName} | Â |
%{name}i | Request header name | T.B.D |  |
%k | Number of keep-alive requests on this connection | {number:KeepAlive} | Â |
%l | The level of the message | {priority:Level,emerg;alert;crit;error;warn;notice;info;debug;trace1;trace2;trace3;trace4;trace5;trace6;trace7;trace8;ftype=status} | status |
 | Operation T.B.D | {text:Operation} |  |
%L | Log ID of the request | {text:LogId,ftype=logid} | logid |
%{c}L | Log ID of the connection | T.B.D | Â |
%{C}L | Log ID of the connection if used in connection scope, empty otherwise | T.B.D | Â |
%m | Name of the module logging the message | {text:Module} | Â |
%M | The actual error message | {string:Message,ftype=Message} | Message |
%{name}n | Request note name | T.B.D |  |
%P | Process ID of current process | Â {text:pid,ftype=pid} | Â pid |
%T | Thread ID of current thread | Â {text:ThreadID,ftype=threadid} | threadid |
%{g}T | System unique thread ID of current thread (the same ID as displayed by e.g. top ; currently Linux only) |  {text:ThreadId,ftype=threadid} | threadid |
%t | Date | {date:Date,locale=en,EEE MMM dd HH:mm:ss.SSSSSS yyyy} | Â |
%{u}t | The current time including micro-seconds | {date:Date,locale=en,EEE MMM dd HH:mm:ss.SSSSSS yyyy} | Â |
%{cu}t | The current time in compact ISO 8601 format, including micro-seconds | {date:Date,locale=en,EEE MMM dd HH:mm:ss.SSSSSS yyyy} | Â |
%v | The canonical ServerName  of the current server. | {text:ServerName,ftype=servername} | servername |
%V | The server name of the server serving the request according to the UseCanonicalName  setting. | {text:ServerName,ftype=servername} The server name according to the UseCanonicalName setting. | servername |
 |  |  |  |
Â