public class ModSecurityAuditEvent extends Object implements Comparable<AuditEvent>, Serializable, AuditEvent
| Modifier and Type | Field and Description |
|---|---|
protected String |
eventId
a unique event_id
|
protected static Long |
evtCount
a count of all events alive
|
static SimpleDateFormat |
fmt
the format in which the date is printed out
|
AGE, EVENT_ID, EVENT_TAGS, EVENT_URL, FILE, FILE_OFFSET, ID, MESSAGE, RECEIVED_AT, SENSOR, SENSOR_ADDR, SENSOR_ID, SENSOR_NAME, SENSOR_TYPE, SESSION_ID, SEVERITY, SITE_ID, SITE_NAME, SIZE, TAGS, VARIABLES| Modifier | Constructor and Description |
|---|---|
protected |
ModSecurityAuditEvent(AuditEventType type) |
|
ModSecurityAuditEvent(ModSecurityAuditEvent evt)
This clone-constructor creates a copy of the given audit-event.
|
|
ModSecurityAuditEvent(String[] data,
AuditEventType type)
This creates an instance of this class by parsing all fields from the
given string-array.
|
|
ModSecurityAuditEvent(String id,
String[] data,
AuditEventType type)
This constructor is used, when reading audit-events from a file.
|
|
ModSecurityAuditEvent(String id,
String[] data,
File f,
long off,
long size,
AuditEventType type) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AuditEvent o) |
int |
compareTo(ModSecurityAuditEvent o) |
boolean |
equals(ModSecurityAuditEvent o) |
protected void |
finalize() |
String |
get(String variable)
Returns the given variable as
String or an empty string if
the variable is not set. |
List<String> |
getAll(String v)
This method returns the list of a collection which if referenced by the
given variable
var. |
AuditEventType |
getAuditEventType() |
String |
getAuditHeader() |
String |
getAuditLogTrailer()
Deprecated.
|
Long |
getCount() |
Date |
getDate()
Returns the date of this events birth.
|
String |
getEventId()
The unique ID, created by modsecurity.
|
AuditEventMessage[] |
getEventMessages() |
File |
getFile() |
static Long |
getInstanceCount() |
long |
getOffset() |
String[] |
getRawData()
This method returns an array of strings that contain the section-data of
the appopriate audit-log entry of this event.
|
String |
getRequestBody() |
String |
getRequestHeader() |
URL |
getRequestURL() |
String |
getResponseHeader()
Deprecated.
|
String |
getSection(int i)
Returns the string, which contains the whole section of this audit-event.
|
String[] |
getSections() |
String |
getSessionId()
The session-id of this request or an empty string, if no session-id has
been set.
|
long |
getSize() |
Set<String> |
getTags() |
Long |
getTimestamp()
Returns the time of this event in milliseconds since 1970.
|
EventType |
getType() |
List<String> |
getVariables()
This method returns the list of all variables available in this event.
|
boolean |
isSet(String var)
Checks wether the given variable is set or not.
|
protected void |
parseSections(String[] sections) |
void |
recycle() |
void |
set(String var,
String val)
This method can be used to modify/set properties of the event.
|
void |
setAll(String variable,
List<String> values)
This method can be used to modify/set a collection of the event.
|
void |
setSessionId(String id)
This method sets the session-id of this event.
|
void |
tag(String tag) |
String |
toString()
Override
Object.toString() by returning a String of all
sections. |
void |
untag(String tag) |
protected static Long evtCount
public static final SimpleDateFormat fmt
protected String eventId
protected ModSecurityAuditEvent(AuditEventType type)
public ModSecurityAuditEvent(ModSecurityAuditEvent evt) throws Exception
evt - The event to clone.Exceptionpublic ModSecurityAuditEvent(String[] data, AuditEventType type) throws ParseException
data - An array containing all audit-sections.Exception - in case parsing failed.ParseExceptionpublic ModSecurityAuditEvent(String id, String[] data, File f, long off, long size, AuditEventType type) throws ParseException
id - data - f - off - size - type - ParseExceptionpublic ModSecurityAuditEvent(String id, String[] data, AuditEventType type) throws Exception
id - The id that the new event should contain.data - The section-data.Exception - In case anything goes wrong (Parsing, etc...)public String[] getSections()
public Long getTimestamp()
EventgetTimestamp in interface Eventprotected void parseSections(String[] sections) throws ParseException
ParseExceptionpublic String getEventId()
AuditEventgetEventId in interface AuditEventorg.modsecurity.audit.AuditEvent#getEventId()public String getSection(int i)
AuditEventModSecurity.java.getSection in interface AuditEventi - Index of the section as defined by
ModSecurity.SECTION_*.public String getAuditHeader()
public String getRequestHeader()
public String getRequestBody()
public String getResponseHeader()
org.modsecurity.audit.AuditEvent#getResponseHeader()public String getAuditLogTrailer()
public Date getDate()
AuditEventgetDate in interface AuditEventpublic String getSessionId()
AuditEventgetSessionId in interface AuditEventpublic void setSessionId(String id)
AuditEventsetSessionId in interface AuditEventid - The id of the session with which this event is associated.public boolean isSet(String var)
AuditEventisSet in interface AuditEventvar - The name of the variable that is checked.true iff the variable is set.public String get(String variable)
AuditEventString or an empty string if
the variable is not set. If the given variable is referring to a
collection the first value of that collection is returned.
To test if a variable has been set, use
isSet(String variable).get in interface Eventget in interface AuditEventvariable - The name of the variable.public List<String> getAll(String v)
AuditEventvar.getAll in interface AuditEventv - The variable name of the collection. May also be a
non-collection variable in which case a single-item list will
returned if the variable has a value.NULL if no
collection is found by that variable name.public List<String> getVariables()
AuditEventgetVariables in interface AuditEventpublic void set(String var, String val)
AuditEventset in interface Eventset in interface AuditEventpublic String toString()
Object.toString() by returning a String of all
sections.public int compareTo(AuditEvent o)
compareTo in interface Comparable<AuditEvent>compareTo in interface AuditEventpublic int compareTo(ModSecurityAuditEvent o)
public boolean equals(ModSecurityAuditEvent o)
public String[] getRawData()
AuditEventgetRawData in interface AuditEventprotected void finalize()
throws Throwable
public Long getCount()
public URL getRequestURL()
public File getFile()
public long getOffset()
public long getSize()
public void recycle()
public void tag(String tag)
public void untag(String tag)
public static Long getInstanceCount()
public void setAll(String variable, List<String> values)
AuditEventsetAll in interface AuditEventpublic AuditEventType getAuditEventType()
getAuditEventType in interface AuditEventpublic AuditEventMessage[] getEventMessages()
getEventMessages in interface AuditEventCopyright © 2015 jwall.org. All Rights Reserved.