Go to the documentation of this file.
67 static int JsonTemplateLogger(
ThreadVars *
tv,
void *thread_data,
68 const Packet *p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
80 jb_open_object(js,
"template");
84 jb_set_string_from_bytes(js,
"request", templatetx->
request_buffer,
104 static void OutputTemplateLogDeInitCtxSub(
OutputCtx *output_ctx)
118 if (
unlikely(templatelog_ctx == NULL)) {
128 output_ctx->
data = templatelog_ctx;
129 output_ctx->
DeInit = OutputTemplateLogDeInitCtxSub;
131 SCLogNotice(
"Template log sub-module initialized.");
135 result.
ctx = output_ctx;
140 static TmEcode JsonTemplateLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
147 if (initdata == NULL) {
148 SCLogDebug(
"Error getting context for EveLogTemplate. \"initdata\" is NULL.");
162 *data = (
void *)thread;
167 if (thread->
buffer != NULL) {
177 if (thread == NULL) {
180 if (thread->
buffer != NULL) {
190 if (
ConfGetNode(
"app-layer.protocols.template") == NULL) {
197 JsonTemplateLogger, JsonTemplateLogThreadInit,
198 JsonTemplateLogThreadDeinit, NULL);
LogTemplateFileCtx * templatelog_ctx
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
#define JSON_OUTPUT_BUFFER_SIZE
struct LogTemplateLogThread_ LogTemplateLogThread
int OutputJsonBuilderBuffer(JsonBuilder *js, LogFileCtx *file_ctx, MemBuffer **buffer)
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr)
uint32_t response_buffer_len
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
LogFileCtx * LogFileEnsureExists(LogFileCtx *parent_ctx, int thread_id)
LogFileEnsureExists() Ensure a log file context for the thread exists.
#define MemBufferReset(mem_buffer)
Reset the mem buffer.
uint8_t * response_buffer
uint32_t request_buffer_len
void(* DeInit)(struct OutputCtx_ *)
void MemBufferFree(MemBuffer *buffer)
void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
void JsonTemplateLogRegister(void)
#define SCLogNotice(...)
Macro used to log NOTICE messages.
MemBuffer * MemBufferCreateNew(uint32_t size)
struct LogTemplateFileCtx_ LogTemplateFileCtx