|
@@ -28,7 +28,8 @@ LOG = logging.getLogger(__name__)
|
|
|
def get_format_types():
|
|
def get_format_types():
|
|
|
return [
|
|
return [
|
|
|
CSVFormat,
|
|
CSVFormat,
|
|
|
- HueFormat
|
|
|
|
|
|
|
+ HueFormat,
|
|
|
|
|
+ ApacheFormat
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
def get_format_mapping():
|
|
def get_format_mapping():
|
|
@@ -147,6 +148,32 @@ class HueFormat(FileFormat):
|
|
|
def fields(self):
|
|
def fields(self):
|
|
|
return self._fields
|
|
return self._fields
|
|
|
|
|
|
|
|
|
|
+class ApacheFormat(FileFormat):
|
|
|
|
|
+ _name = "combined_apache"
|
|
|
|
|
+ _description = _("Combined Apache Log File")
|
|
|
|
|
+ _customizable = False
|
|
|
|
|
+ _extensions = ["log"]
|
|
|
|
|
+
|
|
|
|
|
+ def __init__(self, file_stream, format_):
|
|
|
|
|
+ self._fields = [
|
|
|
|
|
+ Field("clientip", "string"),
|
|
|
|
|
+ Field("ident", "string"),
|
|
|
|
|
+ Field("auth", "string"),
|
|
|
|
|
+ Field("timestamp", "date"),
|
|
|
|
|
+ Field("verb", "string"),
|
|
|
|
|
+ Field("request", "string"),
|
|
|
|
|
+ Field("httpversion", "double"),
|
|
|
|
|
+ Field("rawrequest", "long"),
|
|
|
|
|
+ Field("response", "long"),
|
|
|
|
|
+ Field("bytes", "long"),
|
|
|
|
|
+ Field("referrer", "string"),
|
|
|
|
|
+ Field("message", "text_en")
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+ @property
|
|
|
|
|
+ def fields(self):
|
|
|
|
|
+ return self._fields
|
|
|
|
|
+
|
|
|
class CSVFormat(FileFormat):
|
|
class CSVFormat(FileFormat):
|
|
|
_name = "csv"
|
|
_name = "csv"
|
|
|
_description = _("CSV File")
|
|
_description = _("CSV File")
|