suricata
|
#include "suricata-common.h"
#include "detect.h"
#include "pkt-var.h"
#include "conf.h"
#include "threads.h"
#include "threadvars.h"
#include "tm-threads.h"
#include "util-print.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "output.h"
#include "log-httplog.h"
#include "app-layer-htp.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "util-privs.h"
#include "util-buffer.h"
#include "util-logopenfile.h"
#include "util-time.h"
#include "log-cf-common.h"
Go to the source code of this file.
Data Structures | |
struct | LogHttpFileCtx_ |
struct | LogHttpLogThread_ |
Macros | |
#define | DEFAULT_LOG_FILENAME "http.log" |
#define | MODULE_NAME "LogHttpLog" |
#define | OUTPUT_BUFFER_SIZE 65535 |
#define | LOG_HTTP_CF_REQUEST_HOST 'h' |
#define | LOG_HTTP_CF_REQUEST_PROTOCOL 'H' |
#define | LOG_HTTP_CF_REQUEST_METHOD 'm' |
#define | LOG_HTTP_CF_REQUEST_URI 'u' |
#define | LOG_HTTP_CF_REQUEST_HEADER 'i' |
#define | LOG_HTTP_CF_REQUEST_COOKIE 'C' |
#define | LOG_HTTP_CF_REQUEST_LEN 'b' |
#define | LOG_HTTP_CF_RESPONSE_STATUS 's' |
#define | LOG_HTTP_CF_RESPONSE_HEADER 'o' |
#define | LOG_HTTP_CF_RESPONSE_LEN 'B' |
#define | LOG_HTTP_DEFAULT 0 |
#define | LOG_HTTP_EXTENDED 1 |
#define | LOG_HTTP_CUSTOM 2 |
Typedefs | |
typedef struct LogHttpFileCtx_ | LogHttpFileCtx |
typedef struct LogHttpLogThread_ | LogHttpLogThread |
Functions | |
TmEcode | LogHttpLogThreadInit (ThreadVars *, const void *, void **) |
TmEcode | LogHttpLogThreadDeinit (ThreadVars *, void *) |
int | LogHttpLogger (ThreadVars *tv, void *thread_data, const Packet *, Flow *f, void *state, void *tx, uint64_t tx_id) |
void | LogHttpLogRegister (void) |
OutputInitResult | LogHttpLogInitCtx (ConfNode *conf) |
Create a new http log LogFileCtx. More... | |
Implements http logging portion of the engine.
Definition in file log-httplog.c.
#define DEFAULT_LOG_FILENAME "http.log" |
Definition at line 54 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_COOKIE 'C' |
Definition at line 77 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_HEADER 'i' |
Definition at line 76 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_HOST 'h' |
Definition at line 72 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_LEN 'b' |
Definition at line 78 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_METHOD 'm' |
Definition at line 74 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_PROTOCOL 'H' |
Definition at line 73 of file log-httplog.c.
#define LOG_HTTP_CF_REQUEST_URI 'u' |
Definition at line 75 of file log-httplog.c.
#define LOG_HTTP_CF_RESPONSE_HEADER 'o' |
Definition at line 80 of file log-httplog.c.
#define LOG_HTTP_CF_RESPONSE_LEN 'B' |
Definition at line 81 of file log-httplog.c.
#define LOG_HTTP_CF_RESPONSE_STATUS 's' |
Definition at line 79 of file log-httplog.c.
#define LOG_HTTP_CUSTOM 2 |
Definition at line 92 of file log-httplog.c.
#define LOG_HTTP_DEFAULT 0 |
Definition at line 90 of file log-httplog.c.
#define LOG_HTTP_EXTENDED 1 |
Definition at line 91 of file log-httplog.c.
#define MODULE_NAME "LogHttpLog" |
Definition at line 56 of file log-httplog.c.
#define OUTPUT_BUFFER_SIZE 65535 |
Definition at line 58 of file log-httplog.c.
typedef struct LogHttpFileCtx_ LogHttpFileCtx |
typedef struct LogHttpLogThread_ LogHttpLogThread |
int LogHttpLogger | ( | ThreadVars * | tv, |
void * | thread_data, | ||
const Packet * | p, | ||
Flow * | f, | ||
void * | state, | ||
void * | tx, | ||
uint64_t | tx_id | ||
) |
Definition at line 485 of file log-httplog.c.
References SCEnter.
Referenced by LogHttpLogRegister().
OutputInitResult LogHttpLogInitCtx | ( | ConfNode * | conf | ) |
Create a new http log LogFileCtx.
conf | Pointer to ConfNode containing this loggers configuration. |
Definition at line 548 of file log-httplog.c.
References LogHttpFileCtx_::cf, ConfNodeLookupChildValue(), ConfValIsTrue(), OutputCtx_::data, DEFAULT_LOG_FILENAME, OutputCtx_::DeInit, LogHttpFileCtx_::file_ctx, LogHttpFileCtx_::flags, LOG_HTTP_CUSTOM, LOG_HTTP_DEFAULT, LOG_HTTP_EXTENDED, LogCustomFormatAlloc(), LogCustomFormatParse(), LogFileFreeCtx(), LogFileNewCtx(), SCCalloc, SCConfLogOpenGeneric(), SCLogError, SCLogWarning, and unlikely.
Referenced by LogHttpLogRegister().
void LogHttpLogRegister | ( | void | ) |
Definition at line 65 of file log-httplog.c.
References ALPROTO_HTTP1, LOGGER_HTTP, LogHttpLogger(), LogHttpLogInitCtx(), LogHttpLogThreadDeinit(), LogHttpLogThreadInit(), MODULE_NAME, and OutputRegisterTxModule().
Referenced by OutputRegisterLoggers().
TmEcode LogHttpLogThreadDeinit | ( | ThreadVars * | t, |
void * | data | ||
) |
Definition at line 529 of file log-httplog.c.
References LogHttpLogThread_::buffer, MemBufferFree(), SCFree, and TM_ECODE_OK.
Referenced by LogHttpLogRegister().
TmEcode LogHttpLogThreadInit | ( | ThreadVars * | t, |
const void * | initdata, | ||
void ** | data | ||
) |
Definition at line 503 of file log-httplog.c.
References LogHttpLogThread_::buffer, LogHttpLogThread_::httplog_ctx, MemBufferCreateNew(), OUTPUT_BUFFER_SIZE, SCCalloc, SCFree, SCLogDebug, TM_ECODE_FAILED, TM_ECODE_OK, and unlikely.
Referenced by LogHttpLogRegister().