public abstract class AuditFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
AuditFormat() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
public static int guessFormat(File inFile) throws IOException
IOExceptionpublic static int guessFormat(InputStream in) throws IOException
in - The input-stream to guess the audit-format from.IOExceptionpublic 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.IOExceptionpublic 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.Copyright © 2013 jwall.org. All Rights Reserved.