Go to the documentation of this file.
24 #define FILETYPE_NAME "json-filetype-plugin"
67 static int FiletypeInit(
const ConfNode *conf,
const bool threaded,
void **data)
69 SCLogNotice(
"Initializing template eve output plugin: threaded=%d", threaded);
71 if (context == NULL) {
84 SCLogNotice(
"Read verbose configuration value of %d", verbose);
101 static void FiletypeDeinit(
void *data)
128 static int FiletypeThreadInit(
const void *
ctx,
const ThreadId thread_id,
void **thread_data)
137 *thread_data = tdata;
139 "Initialized thread %03d (pthread_id=%" PRIuMAX
")", tdata->
thread_id, pthread_self());
149 static void FiletypeThreadDeinit(
const void *
ctx,
void *thread_data)
152 if (thread_data == NULL) {
159 "Deinitializing thread %d: records written: %" PRIu64, tdata->
thread_id, tdata->
count);
174 static int FiletypeWrite(
175 const char *buffer,
const int buffer_len,
const void *data,
void *thread_data)
185 SCLogNotice(
"Received write with thread_data %p: %s", thread_data, buffer);
198 my_output->
Init = FiletypeInit;
199 my_output->
Deinit = FiletypeDeinit;
202 my_output->
Write = FiletypeWrite;
210 .author =
"FirstName LastName <name@example.org>",
211 .license =
"GPL-2.0-only",
struct ThreadData_ ThreadData
const char * name
The name of the output, used in the configuration.
int(* Write)(const char *buffer, const int buffer_len, const void *init_data, void *thread_data)
Called for each EVE log record.
void(* ThreadDeinit)(const void *init_data, void *thread_data)
Called to deinitialize each thread.
bool SCRegisterEveFileType(SCEveFileType *plugin)
Register an Eve file type.
ConfNode * ConfNodeLookupChild(const ConfNode *node, const char *name)
Lookup a child configuration node by name.
const SCPlugin * SCPluginRegister()
void(* Deinit)(void *init_data)
Final call to deinitialize this filetype.
int ConfGetChildValueBool(const ConfNode *base, const char *name, int *val)
#define SCLogError(...)
Macro used to log ERROR messages.
const SCPlugin PluginRegistration
int(* Init)(const ConfNode *conf, const bool threaded, void **init_data)
Function to initialize this filetype.
int(* ThreadInit)(const void *init_data, const ThreadId thread_id, void **thread_data)
Initialize thread specific data.
#define SCLogNotice(...)
Macro used to log NOTICE messages.
Structure used to define an EVE output file type plugin.