|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwall.web.audit.io.AuditFormat
public abstract class AuditFormat
This class defines several constants for AuditLog file formats. In addition to that it provides a simple static guess-method for a best-effort guess of a file or input-stream. This will result in either a code for a log-format or -1 if no proper format has been found.
| Field Summary | |
|---|---|
static int |
APACHE_ACCESS_LOG
|
static String[] |
FORMAT_NAMES
This array holds names of the known formats |
static int |
IRONBEE_AUDIT_LOG
|
static int |
MOD_SECURITY_1_X_SERIAL_LOG
|
static int |
MOD_SECURITY_2_X_CONCURRENT_LOG
|
static int |
MOD_SECURITY_2_X_SERIAL_LOG
|
static int |
UNKNOWN_FORMAT
|
| Constructor Summary | |
|---|---|
AuditFormat()
|
|
| Method Summary | |
|---|---|
static AuditEventReader |
createReader(String filename,
boolean tail)
This method creates the appropriate reader for a file, denoted by filename. |
static int |
guessFormat(File inFile)
|
static int |
guessFormat(InputStream in)
Return the most probable audit-format for the given input-string. |
static boolean |
isAccessLog(BufferedReader r)
This method checks whether the reader is attached to some standard access-log input. |
static boolean |
isConcurrent2xLog(BufferedReader r)
This method tries to determine whether the reader produces lines in the format of the ModSecurity 2.x concurrent audit-log files. |
static boolean |
isSerial1xLog(BufferedReader r)
This method tries to determine whether the reader produces lines in the format of the ModSecurity 1.x serial audit-log files. |
static boolean |
isSerial2xLog(BufferedReader r)
This method tries to determine whether the reader produces lines in the format of the ModSecurity 2.x serial audit-log files. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN_FORMAT
public static final int APACHE_ACCESS_LOG
public static final int MOD_SECURITY_1_X_SERIAL_LOG
public static final int MOD_SECURITY_2_X_SERIAL_LOG
public static final int MOD_SECURITY_2_X_CONCURRENT_LOG
public static final int IRONBEE_AUDIT_LOG
public static final String[] FORMAT_NAMES
| Constructor Detail |
|---|
public AuditFormat()
| Method Detail |
|---|
public static int guessFormat(File inFile)
throws IOException
IOException
public static int guessFormat(InputStream in)
throws IOException
in - The input-stream to guess the audit-format from.
IOException
public static boolean isAccessLog(BufferedReader r)
throws IOException
true only
if the lines read from the reader are matching Apache's standard
access-logs.
r - The reader to read input data from.
true, if the lines read from the reader are in
standard access-log format.
IOException
public static boolean isConcurrent2xLog(BufferedReader r)
throws IOException
r - The reader used to read audit-data from the index-file source.
true if the audit-log data could be parsed using the
ModSecurity 2.x index audit-format.
IOException - In case an I/O (read) error occurred.
public static boolean isSerial1xLog(BufferedReader r)
throws IOException
r - The reader to read audit-data from.
true if the audit-log data could be parsed using the
ModSecurity 1.x audit-format.
IOException - In case an I/O (read) error occurred.
public static boolean isSerial2xLog(BufferedReader r)
throws IOException
r - The reader to read audit-data from.
true if the audit-log data could be parsed using the
ModSecurity 2.x audit-format.
IOException - In case an I/O (read) error occurred.
public static AuditEventReader createReader(String filename,
boolean tail)
throws IOException,
AuditFormatException
filename.
filename - The file from which audit-log data is to be read.tail - Indicates, whether the reader should skip to the last line of
the file and only read new data which is appended.
IOException - In case an I/O error occurred when trying open/read the file.
AuditFormatException - If the audit-format of the file could not be determined.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||