suricata
output.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2024 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author OISF, Jason Ish <jason.ish@oisf.net>
22  * \author Endace Technology Limited, Jason Ish <jason.ish@endace.com>
23  *
24  * The root logging output for all non-application logging.
25  *
26  * The loggers are made up of a hierarchy of loggers. At the top we
27  * have the root logger which is the main entry point to
28  * logging. Under the root there exists parent loggers that are the
29  * entry point for specific types of loggers such as packet logger,
30  * transaction loggers, etc. Each parent logger may have 0 or more
31  * loggers that actual handle the job of producing output to something
32  * like a file.
33  */
34 
35 #include "suricata-common.h"
36 #include "flow.h"
37 #include "conf.h"
38 #include "tm-threads.h"
39 #include "util-error.h"
40 #include "util-debug.h"
41 #include "output.h"
42 #include "output-eve.h"
43 
44 #include "alert-fastlog.h"
45 #include "alert-debuglog.h"
46 #include "alert-syslog.h"
47 #include "output-json.h"
48 #include "output-json-alert.h"
49 #include "output-json-anomaly.h"
50 #include "output-json-flow.h"
51 #include "output-json-netflow.h"
52 #include "output-json-drop.h"
53 #include "output-eve-stream.h"
54 #include "output-json-http.h"
55 #include "output-json-dns.h"
56 #include "output-json-mdns.h"
57 #include "log-tlsstore.h"
58 #include "output-json-tls.h"
59 #include "log-pcap.h"
60 // for SSHTxLogCondition
61 #include "app-layer-ssh.h"
62 #include "output-json-file.h"
63 #include "output-json-smtp.h"
64 #include "output-json-stats.h"
65 #include "log-tcp-data.h"
66 #include "log-stats.h"
67 #include "output-json-nfs.h"
68 #include "output-json-ftp.h"
69 // for misplaced EveFTPDataAddMetadata
70 #include "app-layer-ftp.h"
71 #include "output-json-smb.h"
72 #include "output-json-ike.h"
73 #include "output-json-dhcp.h"
74 #include "output-json-mqtt.h"
75 #include "output-json-pgsql.h"
76 #include "output-lua.h"
77 #include "output-json-dnp3.h"
78 #include "output-json-metadata.h"
79 #include "output-json-dcerpc.h"
80 #include "output-json-frame.h"
81 #include "app-layer-parser.h"
82 #include "output-filestore.h"
83 #include "output-json-arp.h"
84 #include "output-json-llmnr.h"
85 
86 typedef struct RootLogger_ {
91 
92  TAILQ_ENTRY(RootLogger_) entries;
94 
95 /* List of registered root loggers. These are registered at start up and
96  * are independent of configuration. Later we will build a list of active
97  * loggers based on configuration. */
98 static TAILQ_HEAD(, RootLogger_) registered_loggers =
99  TAILQ_HEAD_INITIALIZER(registered_loggers);
100 
101 /* List of active root loggers. This means that at least one logger is enabled
102  * for each root logger type in the config. */
103 static TAILQ_HEAD(, RootLogger_) active_loggers =
104  TAILQ_HEAD_INITIALIZER(active_loggers);
105 
106 typedef struct LoggerThreadStoreNode_ {
107  void *thread_data;
108  TAILQ_ENTRY(LoggerThreadStoreNode_) entries;
110 
111 typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_) LoggerThreadStore;
112 
113 /**
114  * The list of all registered (known) output modules.
115  */
117 
118 /**
119  * Registry of flags to be updated on file rotation notification.
120  */
121 typedef struct OutputFileRolloverFlag_ {
122  int *flag;
123 
124  TAILQ_ENTRY(OutputFileRolloverFlag_) entries;
126 
127 static SCMutex output_file_rotation_mutex = SCMUTEX_INITIALIZER;
128 
129 TAILQ_HEAD(, OutputFileRolloverFlag_) output_file_rotation_flags =
130  TAILQ_HEAD_INITIALIZER(output_file_rotation_flags);
131 
132 /**
133  * Callback function to be called when logging is ready.
134  */
135 typedef void (*SCOnLoggingReadyCallback)(void *arg);
136 
137 /**
138  * List entries for callbacks registered to be called when the logging system is
139  * ready. This is useful for both plugins and library users who need to register
140  * application transaction loggers after logging initialization is complete.
141  */
142 typedef struct OnLoggingReadyCallbackNode_ {
143  SCOnLoggingReadyCallback callback;
144  void *arg;
145  TAILQ_ENTRY(OnLoggingReadyCallbackNode_) entries;
147 
148 /**
149  * The list of callbacks to be called when logging is ready.
150  */
151 static TAILQ_HEAD(, OnLoggingReadyCallbackNode_)
152  on_logging_ready_callbacks = TAILQ_HEAD_INITIALIZER(on_logging_ready_callbacks);
153 
154 void OutputRegisterRootLoggers(void);
155 void OutputRegisterLoggers(void);
156 
157 /**
158  * \brief Register an output module.
159  *
160  * This function will register an output module so it can be
161  * configured with the configuration file.
162  *
163  * \retval Returns 0 on success, -1 on failure.
164  */
165 void OutputRegisterModule(const char *name, const char *conf_name,
166  OutputInitFunc InitFunc)
167 {
168  OutputModule *module = SCCalloc(1, sizeof(*module));
169  if (unlikely(module == NULL))
170  goto error;
171 
172  module->name = name;
173  module->conf_name = conf_name;
174  module->InitFunc = InitFunc;
175  TAILQ_INSERT_TAIL(&output_modules, module, entries);
176 
177  SCLogDebug("Output module \"%s\" registered.", name);
178 
179  return;
180 
181 error:
182  FatalError("Fatal error encountered in OutputRegisterModule. Exiting...");
183 }
184 
185 /**
186  * \brief Register a packet output module.
187  *
188  * This function will register an output module so it can be
189  * configured with the configuration file.
190  *
191  * \retval Returns 0 on success, -1 on failure.
192  */
193 void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
194  OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
195 {
196  if (unlikely(output_module_functions->LogFunc == NULL ||
197  output_module_functions->ConditionFunc == NULL)) {
198  goto error;
199  }
200 
201  OutputModule *module = SCCalloc(1, sizeof(*module));
202  if (unlikely(module == NULL)) {
203  goto error;
204  }
205 
206  module->logger_id = id;
207  module->name = name;
208  module->conf_name = conf_name;
209  module->InitFunc = InitFunc;
210  module->PacketLogFunc = output_module_functions->LogFunc;
211  module->PacketConditionFunc = output_module_functions->ConditionFunc;
212  module->ThreadInit = output_module_functions->ThreadInitFunc;
213  module->ThreadDeinit = output_module_functions->ThreadDeinitFunc;
214  TAILQ_INSERT_TAIL(&output_modules, module, entries);
215 
216  SCLogDebug("Packet logger \"%s\" registered.", name);
217  return;
218 error:
219  FatalError("Fatal error encountered. Exiting...");
220 }
221 
222 /**
223  * \brief Register a packet output sub-module.
224  *
225  * This function will register an output module so it can be
226  * configured with the configuration file.
227  *
228  * \retval Returns 0 on success, -1 on failure.
229  */
230 void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name,
231  const char *conf_name, OutputInitSubFunc InitFunc,
232  OutputPacketLoggerFunctions *output_logger_functions)
233 {
234  if (unlikely(output_logger_functions->LogFunc == NULL ||
235  output_logger_functions->ConditionFunc == NULL)) {
236  goto error;
237  }
238 
239  OutputModule *module = SCCalloc(1, sizeof(*module));
240  if (unlikely(module == NULL)) {
241  goto error;
242  }
243 
244  module->logger_id = id;
245  module->name = name;
246  module->conf_name = conf_name;
247  module->parent_name = parent_name;
248  module->InitSubFunc = InitFunc;
249  module->PacketLogFunc = output_logger_functions->LogFunc;
250  module->PacketConditionFunc = output_logger_functions->ConditionFunc;
251  module->ThreadInit = output_logger_functions->ThreadInitFunc;
252  module->ThreadDeinit = output_logger_functions->ThreadDeinitFunc;
253  TAILQ_INSERT_TAIL(&output_modules, module, entries);
254 
255  SCLogDebug("Packet logger \"%s\" registered.", name);
256  return;
257 error:
258  FatalError("Fatal error encountered. Exiting...");
259 }
260 
261 /**
262  * \brief Wrapper function for tx output modules.
263  *
264  * This function will register an output module so it can be
265  * configured with the configuration file.
266  *
267  * \retval Returns 0 on success, -1 on failure.
268  */
269 static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name, const char *conf_name,
270  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
271  int ts_log_progress, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
272  ThreadDeinitFunc ThreadDeinit)
273 {
274  if (unlikely(TxLogFunc == NULL)) {
275  goto error;
276  }
277 
278  OutputModule *module = SCCalloc(1, sizeof(*module));
279  if (unlikely(module == NULL)) {
280  goto error;
281  }
282 
283  module->logger_id = id;
284  module->name = name;
285  module->conf_name = conf_name;
286  module->InitFunc = InitFunc;
287  module->TxLogFunc = TxLogFunc;
288  module->TxLogCondition = TxLogCondition;
289  module->alproto = alproto;
290  module->tc_log_progress = tc_log_progress;
291  module->ts_log_progress = ts_log_progress;
292  module->ThreadInit = ThreadInit;
293  module->ThreadDeinit = ThreadDeinit;
294  TAILQ_INSERT_TAIL(&output_modules, module, entries);
295 
296  SCLogDebug("Tx logger \"%s\" registered.", name);
297  return;
298 error:
299  FatalError("Fatal error encountered. Exiting...");
300 }
301 
302 static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name, const char *name,
303  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
304  int tc_log_progress, int ts_log_progress, TxLoggerCondition TxLogCondition,
305  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
306 {
307  if (unlikely(TxLogFunc == NULL)) {
308  goto error;
309  }
310 
311  OutputModule *module = SCCalloc(1, sizeof(*module));
312  if (unlikely(module == NULL)) {
313  goto error;
314  }
315 
316  module->logger_id = id;
317  module->name = name;
318  module->conf_name = conf_name;
319  module->parent_name = parent_name;
320  module->InitSubFunc = InitFunc;
321  module->TxLogFunc = TxLogFunc;
322  module->TxLogCondition = TxLogCondition;
323  module->alproto = alproto;
324  module->tc_log_progress = tc_log_progress;
325  module->ts_log_progress = ts_log_progress;
326  module->ThreadInit = ThreadInit;
327  module->ThreadDeinit = ThreadDeinit;
328  TAILQ_INSERT_TAIL(&output_modules, module, entries);
329 
330  SCLogDebug("Tx logger for alproto %d \"%s\" registered.", alproto, name);
331  return;
332 error:
333  FatalError("Fatal error encountered. Exiting...");
334 }
335 
336 /**
337  * \brief Register a tx output module with condition.
338  *
339  * This function will register an output module so it can be
340  * configured with the configuration file.
341  *
342  * \retval Returns 0 on success, -1 on failure.
343  */
344 void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name,
345  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
346  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
347 {
348  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1,
349  TxLogCondition, ThreadInit, ThreadDeinit);
350 }
351 
352 void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name,
353  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
354  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
355 {
356  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
357  -1, -1, TxLogCondition, ThreadInit, ThreadDeinit);
358 }
359 
360 /**
361  * \brief Register a tx output module with progress.
362  *
363  * This function will register an output module so it can be
364  * configured with the configuration file.
365  *
366  * \retval Returns 0 on success, -1 on failure.
367  */
368 void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name,
369  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
370  int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
371 {
372  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc,
373  tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
374 }
375 
376 void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name,
377  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
378  int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit,
379  ThreadDeinitFunc ThreadDeinit)
380 {
381  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
382  tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
383 }
384 
385 /**
386  * \brief Register a tx output module.
387  *
388  * This function will register an output module so it can be
389  * configured with the configuration file.
390  *
391  * \retval Returns 0 on success, -1 on failure.
392  */
393 void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name,
394  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
395  ThreadDeinitFunc ThreadDeinit)
396 {
397  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1, NULL,
398  ThreadInit, ThreadDeinit);
399 }
400 
401 void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name,
402  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
403  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
404 {
405  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
406  -1, -1, NULL, ThreadInit, ThreadDeinit);
407 }
408 
409 /**
410  * \brief Register a file output sub-module.
411  *
412  * This function will register an output module so it can be
413  * configured with the configuration file.
414  *
415  * \retval Returns 0 on success, -1 on failure.
416  */
417 void OutputRegisterFileSubModule(LoggerId id, const char *parent_name, const char *name,
418  const char *conf_name, OutputInitSubFunc InitFunc, SCFileLogger FileLogFunc,
419  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
420 {
421  if (unlikely(FileLogFunc == NULL)) {
422  goto error;
423  }
424 
425  OutputModule *module = SCCalloc(1, sizeof(*module));
426  if (unlikely(module == NULL)) {
427  goto error;
428  }
429 
430  module->logger_id = id;
431  module->name = name;
432  module->conf_name = conf_name;
433  module->parent_name = parent_name;
434  module->InitSubFunc = InitFunc;
435  module->FileLogFunc = FileLogFunc;
436  module->ThreadInit = ThreadInit;
437  module->ThreadDeinit = ThreadDeinit;
438  TAILQ_INSERT_TAIL(&output_modules, module, entries);
439 
440  SCLogDebug("File logger \"%s\" registered.", name);
441  return;
442 error:
443  FatalError("Fatal error encountered. Exiting...");
444 }
445 
446 /**
447  * \brief Register a file data output module.
448  *
449  * This function will register an output module so it can be
450  * configured with the configuration file.
451  *
452  * \retval Returns 0 on success, -1 on failure.
453  */
454 void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name,
455  OutputInitFunc InitFunc, SCFiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
456  ThreadDeinitFunc ThreadDeinit)
457 {
458  if (unlikely(FiledataLogFunc == NULL)) {
459  goto error;
460  }
461 
462  OutputModule *module = SCCalloc(1, sizeof(*module));
463  if (unlikely(module == NULL)) {
464  goto error;
465  }
466 
467  module->logger_id = id;
468  module->name = name;
469  module->conf_name = conf_name;
470  module->InitFunc = InitFunc;
471  module->FiledataLogFunc = FiledataLogFunc;
472  module->ThreadInit = ThreadInit;
473  module->ThreadDeinit = ThreadDeinit;
474  TAILQ_INSERT_TAIL(&output_modules, module, entries);
475 
476  SCLogDebug("Filedata logger \"%s\" registered.", name);
477  return;
478 error:
479  FatalError("Fatal error encountered. Exiting...");
480 }
481 
482 /**
483  * \brief Register a flow output sub-module.
484  *
485  * This function will register an output module so it can be
486  * configured with the configuration file.
487  *
488  * \retval Returns 0 on success, -1 on failure.
489  */
490 void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name,
491  const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc,
492  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
493 {
494  if (unlikely(FlowLogFunc == NULL)) {
495  goto error;
496  }
497 
498  OutputModule *module = SCCalloc(1, sizeof(*module));
499  if (unlikely(module == NULL)) {
500  goto error;
501  }
502 
503  module->logger_id = id;
504  module->name = name;
505  module->conf_name = conf_name;
506  module->parent_name = parent_name;
507  module->InitSubFunc = InitFunc;
508  module->FlowLogFunc = FlowLogFunc;
509  module->ThreadInit = ThreadInit;
510  module->ThreadDeinit = ThreadDeinit;
511  TAILQ_INSERT_TAIL(&output_modules, module, entries);
512 
513  SCLogDebug("Flow logger \"%s\" registered.", name);
514  return;
515 error:
516  FatalError("Fatal error encountered. Exiting...");
517 }
518 
519 /**
520  * \brief Register a streaming data output module.
521  *
522  * This function will register an output module so it can be
523  * configured with the configuration file.
524  *
525  * \retval Returns 0 on success, -1 on failure.
526  */
527 void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name,
528  OutputInitFunc InitFunc, SCStreamingLogger StreamingLogFunc,
529  enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit,
530  ThreadDeinitFunc ThreadDeinit)
531 {
532  if (unlikely(StreamingLogFunc == NULL)) {
533  goto error;
534  }
535 
536  OutputModule *module = SCCalloc(1, sizeof(*module));
537  if (unlikely(module == NULL)) {
538  goto error;
539  }
540 
541  module->logger_id = id;
542  module->name = name;
543  module->conf_name = conf_name;
544  module->InitFunc = InitFunc;
545  module->StreamingLogFunc = StreamingLogFunc;
546  module->stream_type = stream_type;
547  module->ThreadInit = ThreadInit;
548  module->ThreadDeinit = ThreadDeinit;
549  TAILQ_INSERT_TAIL(&output_modules, module, entries);
550 
551  SCLogDebug("Streaming logger \"%s\" registered.", name);
552  return;
553 error:
554  FatalError("Fatal error encountered. Exiting...");
555 }
556 
557 /**
558  * \brief Register a stats data output module.
559  *
560  * This function will register an output module so it can be
561  * configured with the configuration file.
562  *
563  * \retval Returns 0 on success, -1 on failure.
564  */
565 void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name,
566  OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
567  ThreadDeinitFunc ThreadDeinit)
568 {
569  if (unlikely(StatsLogFunc == NULL)) {
570  goto error;
571  }
572 
573  OutputModule *module = SCCalloc(1, sizeof(*module));
574  if (unlikely(module == NULL)) {
575  goto error;
576  }
577 
578  module->logger_id = id;
579  module->name = name;
580  module->conf_name = conf_name;
581  module->InitFunc = InitFunc;
582  module->StatsLogFunc = StatsLogFunc;
583  module->ThreadInit = ThreadInit;
584  module->ThreadDeinit = ThreadDeinit;
585  TAILQ_INSERT_TAIL(&output_modules, module, entries);
586 
587  SCLogDebug("Stats logger \"%s\" registered.", name);
588  return;
589 error:
590  FatalError("Fatal error encountered. Exiting...");
591 }
592 
593 /**
594  * \brief Register a stats data output sub-module.
595  *
596  * This function will register an output module so it can be
597  * configured with the configuration file.
598  *
599  * \retval Returns 0 on success, -1 on failure.
600  */
601 void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name,
602  const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc,
603  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
604 {
605  if (unlikely(StatsLogFunc == NULL)) {
606  goto error;
607  }
608 
609  OutputModule *module = SCCalloc(1, sizeof(*module));
610  if (unlikely(module == NULL)) {
611  goto error;
612  }
613 
614  module->logger_id = id;
615  module->name = name;
616  module->conf_name = conf_name;
617  module->parent_name = parent_name;
618  module->InitSubFunc = InitFunc;
619  module->StatsLogFunc = StatsLogFunc;
620  module->ThreadInit = ThreadInit;
621  module->ThreadDeinit = ThreadDeinit;
622  TAILQ_INSERT_TAIL(&output_modules, module, entries);
623 
624  SCLogDebug("Stats logger \"%s\" registered.", name);
625  return;
626 error:
627  FatalError("Fatal error encountered. Exiting...");
628 }
629 
630 /**
631  * \brief Get an output module by name.
632  *
633  * \retval The OutputModule with the given name or NULL if no output module
634  * with the given name is registered.
635  */
637 {
638  OutputModule *module;
639 
640  TAILQ_FOREACH(module, &output_modules, entries) {
641  if (strcmp(module->conf_name, conf_name) == 0)
642  return module;
643  }
644 
645  return NULL;
646 }
647 
648 static EveJsonSimpleAppLayerLogger *simple_json_applayer_loggers;
649 
650 /**
651  * \brief Deregister all modules. Useful for a memory clean exit.
652  */
654 {
655  OutputModule *module;
656 
657  while ((module = TAILQ_FIRST(&output_modules))) {
658  TAILQ_REMOVE(&output_modules, module, entries);
659  SCFree(module);
660  }
661  SCFree(simple_json_applayer_loggers);
662  simple_json_applayer_loggers = NULL;
663 }
664 
665 static int drop_loggers = 0;
666 
668 {
669  if (drop_loggers)
670  return -1;
671  drop_loggers++;
672  return 0;
673 }
674 
676 {
677  if (drop_loggers)
678  drop_loggers--;
679 }
680 
681 /**
682  * \brief Register a flag for file rotation notification.
683  *
684  * \param flag A pointer that will be set to 1 when file rotation is
685  * requested.
686  */
688 {
689  OutputFileRolloverFlag *flag_entry = SCCalloc(1, sizeof(*flag_entry));
690  if (unlikely(flag_entry == NULL)) {
691  SCLogError("Failed to allocate memory to register file rotation flag");
692  return;
693  }
694  flag_entry->flag = flag;
695  SCMutexLock(&output_file_rotation_mutex);
696  TAILQ_INSERT_TAIL(&output_file_rotation_flags, flag_entry, entries);
697  SCMutexUnlock(&output_file_rotation_mutex);
698 }
699 
700 /**
701  * \brief Unregister a file rotation flag.
702  *
703  * Note that it is safe to call this function with a flag that may not
704  * have been registered, in which case this function won't do
705  * anything.
706  *
707  * \param flag A pointer that has been previously registered for file
708  * rotation notifications.
709  */
711 {
712  OutputFileRolloverFlag *entry, *next;
713  SCMutexLock(&output_file_rotation_mutex);
714  for (entry = TAILQ_FIRST(&output_file_rotation_flags); entry != NULL;
715  entry = next) {
716  next = TAILQ_NEXT(entry, entries);
717  if (entry->flag == flag) {
718  TAILQ_REMOVE(&output_file_rotation_flags, entry, entries);
719  SCMutexUnlock(&output_file_rotation_mutex);
720  SCFree(entry);
721  return;
722  }
723  }
724  SCMutexUnlock(&output_file_rotation_mutex);
725 }
726 
727 /**
728  * \brief Notifies all registered file rotation notification flags.
729  */
731  OutputFileRolloverFlag *flag = NULL;
732  OutputFileRolloverFlag *tflag;
733  SCMutexLock(&output_file_rotation_mutex);
734  TAILQ_FOREACH_SAFE (flag, &output_file_rotation_flags, entries, tflag) {
735  *(flag->flag) = 1;
736  }
737  SCMutexUnlock(&output_file_rotation_mutex);
738 }
739 
740 /**
741  * \brief Register a callback to be called when logging is ready.
742  *
743  * This function registers a callback that will be invoked when the logging
744  * system has been fully initialized. This is useful for both plugins and
745  * library users who need to register application transaction loggers after
746  * logging initialization is complete.
747  *
748  * \param callback The callback function to be called
749  * \param arg An argument to be passed to the callback function
750  * \return 0 on success, -1 on failure
751  */
753 {
754  OnLoggingReadyCallbackNode *node = SCCalloc(1, sizeof(*node));
755  if (node == NULL) {
756  SCLogError("Failed to allocate memory for callback node");
757  return -1;
758  }
759 
760  node->callback = callback;
761  node->arg = arg;
762  TAILQ_INSERT_TAIL(&on_logging_ready_callbacks, node, entries);
763 
764  return 0;
765 }
766 
767 /**
768  * \brief Invokes all registered logging ready callbacks.
769  *
770  * This function should be called after the logging system has been fully
771  * initialized to notify all registered callbacks that logging is ready.
772  */
774 {
775  OnLoggingReadyCallbackNode *node = NULL;
776  TAILQ_FOREACH (node, &on_logging_ready_callbacks, entries) {
777  if (node->callback) {
778  (*node->callback)(node->arg);
779  }
780  }
781 }
782 
783 TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
784 {
785  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
786  RootLogger *logger = TAILQ_FIRST(&active_loggers);
787  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
788  while (logger && thread_store_node) {
789  logger->LogFunc(tv, p, thread_store_node->thread_data);
790 
791  logger = TAILQ_NEXT(logger, entries);
792  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
793  }
794  return TM_ECODE_OK;
795 }
796 
797 TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
798 {
799  LoggerThreadStore *thread_store = SCCalloc(1, sizeof(*thread_store));
800  if (thread_store == NULL) {
801  return TM_ECODE_FAILED;
802  }
803  TAILQ_INIT(thread_store);
804  *data = (void *)thread_store;
805 
806  RootLogger *logger;
807  TAILQ_FOREACH(logger, &active_loggers, entries) {
808 
809  void *child_thread_data = NULL;
810  if (logger->ThreadInit != NULL) {
811  if (logger->ThreadInit(tv, initdata, &child_thread_data) == TM_ECODE_OK) {
812  LoggerThreadStoreNode *thread_store_node =
813  SCCalloc(1, sizeof(*thread_store_node));
814  if (thread_store_node == NULL) {
815  /* Undo everything, calling de-init will take care
816  * of that. */
817  OutputLoggerThreadDeinit(tv, thread_store);
818  return TM_ECODE_FAILED;
819  }
820  thread_store_node->thread_data = child_thread_data;
821  TAILQ_INSERT_TAIL(thread_store, thread_store_node, entries);
822  }
823  }
824  }
825  return TM_ECODE_OK;
826 }
827 
829 {
830  if (thread_data == NULL)
831  return TM_ECODE_FAILED;
832 
833  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
834  RootLogger *logger = TAILQ_FIRST(&active_loggers);
835  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
836  while (logger && thread_store_node) {
837  if (logger->ThreadDeinit != NULL) {
838  logger->ThreadDeinit(tv, thread_store_node->thread_data);
839  }
840  logger = TAILQ_NEXT(logger, entries);
841  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
842  }
843 
844  /* Free the thread store. */
845  while ((thread_store_node = TAILQ_FIRST(thread_store)) != NULL) {
846  TAILQ_REMOVE(thread_store, thread_store_node, entries);
847  SCFree(thread_store_node);
848  }
849  SCFree(thread_store);
850 
851  return TM_ECODE_OK;
852 }
853 
855  OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
856 {
857  BUG_ON(LogFunc == NULL);
858 
859  RootLogger *logger = SCCalloc(1, sizeof(*logger));
860  if (logger == NULL) {
861  FatalError("failed to alloc root logger");
862  }
863  logger->ThreadInit = ThreadInit;
864  logger->ThreadDeinit = ThreadDeinit;
865  logger->LogFunc = LogFunc;
866  logger->ActiveCntFunc = ActiveCntFunc;
867  TAILQ_INSERT_TAIL(&registered_loggers, logger, entries);
868 }
869 
870 static void OutputRegisterActiveLogger(RootLogger *reg)
871 {
872  RootLogger *logger = SCCalloc(1, sizeof(*logger));
873  if (logger == NULL) {
874  FatalError("failed to alloc root logger");
875  }
876  logger->ThreadInit = reg->ThreadInit;
877  logger->ThreadDeinit = reg->ThreadDeinit;
878  logger->LogFunc = reg->LogFunc;
879  logger->ActiveCntFunc = reg->ActiveCntFunc;
880  TAILQ_INSERT_TAIL(&active_loggers, logger, entries);
881 }
882 
884 {
885  RootLogger *logger = TAILQ_FIRST(&registered_loggers);
886  while (logger) {
887  uint32_t cnt = logger->ActiveCntFunc();
888  if (cnt) {
889  OutputRegisterActiveLogger(logger);
890  }
891 
892  logger = TAILQ_NEXT(logger, entries);
893  }
894 }
895 
897 {
898  RootLogger *logger;
899  while ((logger = TAILQ_FIRST(&active_loggers)) != NULL) {
900  TAILQ_REMOVE(&active_loggers, logger, entries);
901  SCFree(logger);
902  }
903 }
904 
906 {
909 }
910 
912 {
913  if (alproto < g_alproto_max) {
914  return &simple_json_applayer_loggers[alproto];
915  }
916  return NULL;
917 }
918 
919 static void RegisterSimpleJsonApplayerLogger(
920  AppProto alproto, EveJsonSimpleTxLogFunc LogTx, const char *name)
921 {
922  simple_json_applayer_loggers[alproto].LogTx = LogTx;
923  if (name) {
924  simple_json_applayer_loggers[alproto].name = name;
925  } else {
926  simple_json_applayer_loggers[alproto].name = AppProtoToString(alproto);
927  }
928 }
929 
930 /**
931  * \brief Register all root loggers.
932  */
934 {
935  simple_json_applayer_loggers = SCCalloc(g_alproto_max, sizeof(EveJsonSimpleAppLayerLogger));
936  if (unlikely(simple_json_applayer_loggers == NULL)) {
937  FatalError("Failed to allocate simple_json_applayer_loggers");
938  }
939  // ALPROTO_HTTP1 special: uses some options flags
940  RegisterSimpleJsonApplayerLogger(ALPROTO_FTP, (EveJsonSimpleTxLogFunc)EveFTPLogCommand, NULL);
941  // ALPROTO_SMTP special: uses state
942  RegisterSimpleJsonApplayerLogger(
944  // no cast here but done in rust for SSHTransaction
945  RegisterSimpleJsonApplayerLogger(ALPROTO_SSH, (EveJsonSimpleTxLogFunc)SCSshLogJson, NULL);
946  // ALPROTO_SMB special: uses state
947  // ALPROTO_DCERPC special: uses state
948  RegisterSimpleJsonApplayerLogger(ALPROTO_DNS, (EveJsonSimpleTxLogFunc)AlertJsonDns, NULL);
949  RegisterSimpleJsonApplayerLogger(ALPROTO_MDNS, (EveJsonSimpleTxLogFunc)AlertJsonMdns, NULL);
950  RegisterSimpleJsonApplayerLogger(ALPROTO_LLMNR, (EveJsonSimpleTxLogFunc)AlertJsonLLMNR, NULL);
951  // either need a cast here or in rust for ModbusTransaction, done here
952  RegisterSimpleJsonApplayerLogger(ALPROTO_MODBUS, (EveJsonSimpleTxLogFunc)SCModbusToJson, NULL);
953  RegisterSimpleJsonApplayerLogger(ALPROTO_ENIP, (EveJsonSimpleTxLogFunc)SCEnipLoggerLog, NULL);
954  RegisterSimpleJsonApplayerLogger(ALPROTO_DNP3, (EveJsonSimpleTxLogFunc)AlertJsonDnp3, NULL);
955  // ALPROTO_NFS special: uses state
956  // underscore instead of dash for ftp_data
957  RegisterSimpleJsonApplayerLogger(
959  RegisterSimpleJsonApplayerLogger(
960  ALPROTO_TFTP, (EveJsonSimpleTxLogFunc)SCTftpLogJsonRequest, NULL);
961  // ALPROTO_IKE special: uses state
962  RegisterSimpleJsonApplayerLogger(
963  ALPROTO_KRB5, (EveJsonSimpleTxLogFunc)SCKrb5LogJsonResponse, NULL);
964  RegisterSimpleJsonApplayerLogger(ALPROTO_QUIC, (EveJsonSimpleTxLogFunc)SCQuicLogJson, NULL);
965  RegisterSimpleJsonApplayerLogger(ALPROTO_DHCP, (EveJsonSimpleTxLogFunc)SCDhcpLogJson, NULL);
966  RegisterSimpleJsonApplayerLogger(ALPROTO_SIP, (EveJsonSimpleTxLogFunc)SCSipLogJson, NULL);
967  RegisterSimpleJsonApplayerLogger(ALPROTO_RFB, (EveJsonSimpleTxLogFunc)SCRfbJsonLogger, NULL);
968  RegisterSimpleJsonApplayerLogger(ALPROTO_POP3, (EveJsonSimpleTxLogFunc)SCPop3LoggerLog, NULL);
969  RegisterSimpleJsonApplayerLogger(
971  RegisterSimpleJsonApplayerLogger(
973  RegisterSimpleJsonApplayerLogger(
974  ALPROTO_WEBSOCKET, (EveJsonSimpleTxLogFunc)SCWebSocketLoggerLog, NULL);
975  RegisterSimpleJsonApplayerLogger(ALPROTO_LDAP, (EveJsonSimpleTxLogFunc)SCLdapLoggerLog, NULL);
976  RegisterSimpleJsonApplayerLogger(ALPROTO_DOH2, (EveJsonSimpleTxLogFunc)AlertJsonDoh2, NULL);
977  RegisterSimpleJsonApplayerLogger(
978  ALPROTO_TEMPLATE, (EveJsonSimpleTxLogFunc)SCTemplateLoggerLog, NULL);
979  RegisterSimpleJsonApplayerLogger(ALPROTO_RDP, (EveJsonSimpleTxLogFunc)SCRdpToJson, NULL);
980  // special case : http2 is logged in http object
981  RegisterSimpleJsonApplayerLogger(ALPROTO_HTTP2, (EveJsonSimpleTxLogFunc)SCHttp2LogJson, "http");
982  // underscore instead of dash for bittorrent_dht
983  RegisterSimpleJsonApplayerLogger(ALPROTO_BITTORRENT_DHT,
984  (EveJsonSimpleTxLogFunc)SCBittorrentDhtLogger, "bittorrent_dht");
985 
991 }
992 
993 static int JsonGenericLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
994  void *state, void *tx, uint64_t tx_id, int dir)
995 {
996  OutputJsonThreadCtx *thread = thread_data;
998  if (al == NULL) {
999  return TM_ECODE_FAILED;
1000  }
1001 
1002  SCJsonBuilder *js = CreateEveHeader(p, dir, al->name, NULL, thread->ctx);
1003  if (unlikely(js == NULL)) {
1004  return TM_ECODE_FAILED;
1005  }
1006 
1007  if (!al->LogTx(tx, js)) {
1008  goto error;
1009  }
1010 
1011  OutputJsonBuilderBuffer(tv, p, p->flow, js, thread);
1012  SCJbFree(js);
1013 
1014  return TM_ECODE_OK;
1015 
1016 error:
1017  SCJbFree(js);
1018  return TM_ECODE_FAILED;
1019 }
1020 
1021 static int JsonGenericDirPacketLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
1022  void *state, void *tx, uint64_t tx_id)
1023 {
1024  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_PACKET);
1025 }
1026 
1027 static int JsonGenericDirFlowLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
1028  void *state, void *tx, uint64_t tx_id)
1029 {
1030  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_FLOW);
1031 }
1032 
1033 #define ARRAY_CAP_STEP 16
1034 static EveJsonTxLoggerRegistrationData *preregistered_loggers = NULL;
1035 static size_t preregistered_loggers_nb = 0;
1036 static size_t preregistered_loggers_cap = 0;
1037 
1038 // Plugins can preregister logger with this function :
1039 // When an app-layer plugin is loaded, it wants to register its logger
1040 // But the plugin is loaded before loggers can register
1041 // The preregistration data will later be used by OutputRegisterLoggers
1043 {
1044  if (preregistered_loggers_nb == preregistered_loggers_cap) {
1045  void *tmp = SCRealloc(
1046  preregistered_loggers, sizeof(EveJsonTxLoggerRegistrationData) *
1047  (preregistered_loggers_cap + ARRAY_CAP_STEP));
1048  if (tmp == NULL) {
1049  return 1;
1050  }
1051  preregistered_loggers_cap += ARRAY_CAP_STEP;
1052  preregistered_loggers = tmp;
1053  }
1054  preregistered_loggers[preregistered_loggers_nb] = reg_data;
1055  preregistered_loggers_nb++;
1056  return 0;
1057 }
1058 
1059 static TxLogger JsonLoggerFromDir(uint8_t dir)
1060 {
1061  if (dir == LOG_DIR_PACKET) {
1062  return JsonGenericDirPacketLogger;
1063  }
1064  BUG_ON(dir != LOG_DIR_FLOW);
1065  return JsonGenericDirFlowLogger;
1066 }
1067 
1068 /**
1069  * \brief Register all non-root logging modules.
1070  */
1072 {
1073  LuaLogRegister();
1074  /* fast log */
1076  /* debug log */
1078  /* syslog log */
1082  /* json log */
1084  /* email logs */
1086  /* http log */
1088  OutputRegisterTxSubModuleWithProgress(LOGGER_JSON_TX, "eve-log", "LogHttp2Log", "eve-log.http2",
1089  OutputJsonLogInitSub, ALPROTO_HTTP2, JsonGenericDirFlowLogger, HTTP2ProgClosed,
1090  HTTP2ProgClosed, JsonLogThreadInit, JsonLogThreadDeinit);
1091  /* tls log */
1094  /* ssh */
1095  OutputRegisterTxSubModuleWithCondition(LOGGER_JSON_TX, "eve-log", "JsonSshLog", "eve-log.ssh",
1096  OutputJsonLogInitSub, ALPROTO_SSH, JsonGenericDirFlowLogger, SSHTxLogCondition,
1098  /* pcap log */
1099  PcapLogRegister();
1100  /* file log */
1103  /* dns */
1105  /* mdns */
1107  /* modbus */
1108  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonModbusLog", "eve-log.modbus",
1109  OutputJsonLogInitSub, ALPROTO_MODBUS, JsonGenericDirFlowLogger, JsonLogThreadInit,
1111 
1112  SCLogDebug("modbus json logger registered.");
1113  /* tcp streaming data */
1115  /* log stats */
1117 
1120  /* flow/netflow */
1123  /* json stats */
1125 
1126  /* DNP3. */
1129 
1130  /* NFS JSON logger. */
1132  /* TFTP JSON logger. */
1133  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTFTPLog", "eve-log.tftp",
1134  OutputJsonLogInitSub, ALPROTO_TFTP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1136 
1137  SCLogDebug("TFTP JSON logger registered.");
1138  /* FTP and FTP-DATA JSON loggers. */
1139  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1140  OutputJsonLogInitSub, ALPROTO_FTP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1142  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1143  OutputJsonLogInitSub, ALPROTO_FTPDATA, JsonGenericDirFlowLogger, JsonLogThreadInit,
1145  SCLogDebug("FTP JSON logger registered.");
1146 
1147  /* SMB JSON logger. */
1149  /* IKE JSON logger. */
1151  /* KRB5 JSON logger. */
1152  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonKRB5Log", "eve-log.krb5",
1153  OutputJsonLogInitSub, ALPROTO_KRB5, JsonGenericDirPacketLogger, JsonLogThreadInit,
1155 
1156  SCLogDebug("KRB5 JSON logger registered.");
1157  /* QUIC JSON logger. */
1158  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonQuicLog", "eve-log.quic",
1159  OutputJsonLogInitSub, ALPROTO_QUIC, JsonGenericDirPacketLogger, JsonLogThreadInit,
1161 
1162  SCLogDebug("quic json logger registered.");
1163  /* DHCP JSON logger. */
1165 
1166  /* SIP JSON logger. */
1167  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSIPLog", "eve-log.sip",
1168  OutputJsonLogInitSub, ALPROTO_SIP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1170 
1171  SCLogDebug("SIP JSON logger registered.");
1172  /* RFB JSON logger. */
1173  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRFBLog", "eve-log.rfb",
1174  OutputJsonLogInitSub, ALPROTO_RFB, JsonGenericDirPacketLogger, JsonLogThreadInit,
1176  /* MQTT JSON logger. */
1178  /* Pgsql JSON logger. */
1180  /* WebSocket JSON logger. */
1181  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonWebSocketLog", "eve-log.websocket",
1182  OutputJsonLogInitSub, ALPROTO_WEBSOCKET, JsonGenericDirPacketLogger, JsonLogThreadInit,
1184  /* Enip JSON logger. */
1185  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonEnipLog", "eve-log.enip",
1186  OutputJsonLogInitSub, ALPROTO_ENIP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1188  /* Ldap JSON logger. */
1189  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonLdapLog", "eve-log.ldap",
1190  OutputJsonLogInitSub, ALPROTO_LDAP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1192  /* DoH2 JSON logger. */
1194  /* POP3 JSON logger */
1195  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonPop3Log", "eve-log.pop3",
1196  OutputJsonLogInitSub, ALPROTO_POP3, JsonGenericDirFlowLogger, JsonLogThreadInit,
1198  /* Mdns JSON logger. */
1199  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonMdnsLog", "eve-log.template",
1200  OutputJsonLogInitSub, ALPROTO_MDNS, JsonGenericDirPacketLogger, JsonLogThreadInit,
1202  /* Template JSON logger. */
1203  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateLog", "eve-log.template",
1204  OutputJsonLogInitSub, ALPROTO_TEMPLATE, JsonGenericDirPacketLogger, JsonLogThreadInit,
1206  /* RDP JSON logger. */
1207  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRdpLog", "eve-log.rdp",
1208  OutputJsonLogInitSub, ALPROTO_RDP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1210  SCLogDebug("rdp json logger registered.");
1211  /* DCERPC JSON logger. */
1213  /* app layer frames */
1215  /* BitTorrent DHT JSON logger */
1216  if (SCConfGetNode("app-layer.protocols.bittorrent-dht") != NULL) {
1217  /* Register as an eve sub-module. */
1218  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonBitTorrentDHTLog",
1219  "eve-log.bittorrent-dht", OutputJsonLogInitSub, ALPROTO_BITTORRENT_DHT,
1220  JsonGenericDirPacketLogger, JsonLogThreadInit, JsonLogThreadDeinit);
1221  }
1222  /* ARP JSON logger */
1224  /* LLMNR JSON logger */
1226 
1227  for (size_t i = 0; i < preregistered_loggers_nb; i++) {
1228  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", preregistered_loggers[i].logname,
1229  preregistered_loggers[i].confname, OutputJsonLogInitSub,
1230  preregistered_loggers[i].alproto, JsonLoggerFromDir(preregistered_loggers[i].dir),
1232  SCLogDebug(
1233  "%s JSON logger registered.", AppProtoToString(preregistered_loggers[i].alproto));
1234  RegisterSimpleJsonApplayerLogger(preregistered_loggers[i].alproto,
1235  (EveJsonSimpleTxLogFunc)preregistered_loggers[i].LogTx, NULL);
1236  }
1237 }
RootLogger_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.c:89
log-stats.h
JsonMQTTAddMetadata
bool JsonMQTTAddMetadata(void *vtx, SCJsonBuilder *js)
Definition: output-json-mqtt.c:63
OutputModule_::parent_name
const char * parent_name
Definition: output.h:60
OutputFileRolloverFlag
OutputFileRolloverFlag
Definition: output.c:125
LogTlsStoreRegister
void LogTlsStoreRegister(void)
Definition: log-tlsstore.c:497
tm-threads.h
OutputModule_::FileLogFunc
SCFileLogger FileLogFunc
Definition: output.h:71
output-json-ftp.h
OutputDropLoggerEnable
int OutputDropLoggerEnable(void)
Definition: output.c:667
OutputRegisterStreamingModule
void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCStreamingLogger StreamingLogFunc, enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a streaming data output module.
Definition: output.c:527
LoggerThreadStoreNode
LoggerThreadStoreNode
Definition: output.c:109
OutputLogFunc
TmEcode(* OutputLogFunc)(ThreadVars *, Packet *, void *)
Definition: output.h:53
JsonDoh2LogRegister
void JsonDoh2LogRegister(void)
Definition: output-json-dns.c:695
app-layer-ssh.h
JsonDCERPCLogRegister
void JsonDCERPCLogRegister(void)
Definition: output-json-dcerpc.c:67
OutputTxLoggerRegister
void OutputTxLoggerRegister(void)
Definition: output-tx.c:656
alert-debuglog.h
TAILQ_INIT
#define TAILQ_INIT(head)
Definition: queue.h:262
JsonPgsqlLogRegister
void JsonPgsqlLogRegister(void)
Definition: output-json-pgsql.c:184
ALPROTO_DNS
@ ALPROTO_DNS
Definition: app-layer-protos.h:47
OutputJsonThreadCtx_::ctx
OutputJsonCtx * ctx
Definition: output-json.h:86
JsonTlsLogJSONExtended
bool JsonTlsLogJSONExtended(void *vtx, SCJsonBuilder *tjs)
Definition: output-json-tls.c:523
ALPROTO_ENIP
@ ALPROTO_ENIP
Definition: app-layer-protos.h:49
OutputRegisterTxSubModuleWithProgress
void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Definition: output.c:376
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
EveFTPDataAddMetadata
bool EveFTPDataAddMetadata(void *vtx, SCJsonBuilder *jb)
Definition: app-layer-ftp.c:1405
JsonSMBLogRegister
void JsonSMBLogRegister(void)
Definition: output-json-smb.c:151
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:39
OutputRegisterRootLogger
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
Definition: output.c:854
output-json-mqtt.h
JsonLLMNRLogRegister
void JsonLLMNRLogRegister(void)
Definition: output-json-llmnr.c:156
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
output-eve-stream.h
OutputFileLoggerRegister
void OutputFileLoggerRegister(void)
Definition: output-file.c:235
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
name
const char * name
Definition: detect-engine-proto.c:48
ALPROTO_MODBUS
@ ALPROTO_MODBUS
Definition: app-layer-protos.h:48
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:87
ALPROTO_QUIC
@ ALPROTO_QUIC
Definition: app-layer-protos.h:57
SCFileLogger
int(* SCFileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
Definition: output-file.h:48
ALPROTO_POP3
@ ALPROTO_POP3
Definition: app-layer-protos.h:71
SCEveJsonSimpleGetLogger
EveJsonSimpleAppLayerLogger * SCEveJsonSimpleGetLogger(AppProto alproto)
Definition: output.c:911
CreateEveHeader
SCJsonBuilder * CreateEveHeader(const Packet *p, enum SCOutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Definition: output-json.c:819
JsonLogThreadInit
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
Definition: output-json-common.c:90
OutputModule_::name
const char * name
Definition: output.h:58
Flow_
Flow data structure.
Definition: flow.h:354
OutputModule_::logger_id
LoggerId logger_id
Definition: output.h:57
LoggerId
LoggerId
Definition: suricata-common.h:485
AppProtoToString
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
Definition: app-layer-protos.c:41
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:77
output-json-pgsql.h
JsonFileLogRegister
void JsonFileLogRegister(void)
Definition: output-json-file.c:353
AlertJsonDns
bool AlertJsonDns(void *txptr, SCJsonBuilder *js)
Definition: output-json-dns.c:252
output-json-frame.h
OutputModule_::ts_log_progress
int ts_log_progress
Definition: output.h:79
OutputRegisterStatsSubModule
void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a stats data output sub-module.
Definition: output.c:601
output-json-netflow.h
JsonDNP3LogRegister
void JsonDNP3LogRegister(void)
Definition: output-json-dnp3.c:350
SCOutputEvePreRegisterLogger
int SCOutputEvePreRegisterLogger(EveJsonTxLoggerRegistrationData reg_data)
Definition: output.c:1042
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:252
output-json-arp.h
OutputGetModuleByConfName
OutputModule * OutputGetModuleByConfName(const char *conf_name)
Get an output module by name.
Definition: output.c:636
output-json-tls.h
OutputInitFunc
OutputInitResult(* OutputInitFunc)(SCConfNode *)
Definition: output.h:51
SSHTxLogCondition
bool SSHTxLogCondition(ThreadVars *tv, const Packet *p, void *state, void *tx, uint64_t tx_id)
Definition: app-layer-ssh.c:74
ALPROTO_SIP
@ ALPROTO_SIP
Definition: app-layer-protos.h:59
OutputRegisterTxSubModule
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)
Definition: output.c:401
OutputSetupActiveLoggers
void OutputSetupActiveLoggers(void)
Definition: output.c:883
AlertSyslogRegister
void AlertSyslogRegister(void)
Function to register the AlertSyslog module.
Definition: alert-syslog.c:387
OutputModule_::StatsLogFunc
StatsLogger StatsLogFunc
Definition: output.h:75
SCMutexLock
#define SCMutexLock(mut)
Definition: threads-debug.h:117
ALPROTO_LDAP
@ ALPROTO_LDAP
Definition: app-layer-protos.h:65
JsonDHCPLogRegister
void JsonDHCPLogRegister(void)
Definition: output-json-dhcp.c:146
TxLogger
int(* TxLogger)(ThreadVars *, void *thread_data, const Packet *, Flow *f, void *state, void *tx, uint64_t tx_id)
Transaction logger function pointer type.
Definition: output-tx.h:34
FlowLogger
int(* FlowLogger)(ThreadVars *, void *thread_data, Flow *f)
Flow logger function pointer type.
Definition: output-flow.h:36
ALPROTO_FTP
@ ALPROTO_FTP
Definition: app-layer-protos.h:37
SCMUTEX_INITIALIZER
#define SCMUTEX_INITIALIZER
Definition: threads-debug.h:122
OutputJsonBuilderBuffer
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, SCJsonBuilder *js, OutputJsonThreadCtx *ctx)
Definition: output-json.c:995
TAILQ_INSERT_TAIL
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:294
PcapLogRegister
void PcapLogRegister(void)
Definition: log-pcap.c:220
OutputModule_::InitSubFunc
OutputInitSubFunc InitSubFunc
Definition: output.h:62
OutputRegisterFiledataModule
void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCFiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a file data output module.
Definition: output.c:454
p
Packet * p
Definition: fuzz_iprep.c:21
SCFiledataLogger
int(* SCFiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
File-data logger function pointer type.
Definition: output-filedata.h:51
ALPROTO_SSH
@ ALPROTO_SSH
Definition: app-layer-protos.h:40
app-layer-ftp.h
ALPROTO_DHCP
@ ALPROTO_DHCP
Definition: app-layer-protos.h:58
OutputModule_::PacketLogFunc
PacketLogger PacketLogFunc
Definition: output.h:67
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:82
OutputModule_::FiledataLogFunc
SCFiledataLogger FiledataLogFunc
Definition: output.h:72
JsonStatsLogRegister
void JsonStatsLogRegister(void)
Definition: output-json-stats.c:502
LogTcpDataLogRegister
void LogTcpDataLogRegister(void)
Definition: log-tcp-data.c:46
SCOnLoggingReadyCallback
void(* SCOnLoggingReadyCallback)(void *arg)
Definition: output.h:159
OutputRegisterRootLoggers
void OutputRegisterRootLoggers(void)
Register all root loggers.
Definition: output.c:933
OutputLoggerThreadDeinit
TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data)
Definition: output.c:828
OutputRegisterTxModule
void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module.
Definition: output.c:393
OutputModule_::alproto
AppProto alproto
Definition: output.h:76
JsonTlsLogRegister
void JsonTlsLogRegister(void)
Definition: output-json-tls.c:732
OutputRegisterFileSubModule
void OutputRegisterFileSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, SCFileLogger FileLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a file output sub-module.
Definition: output.c:417
alert-syslog.h
JsonFlowLogRegister
void JsonFlowLogRegister(void)
Definition: output-json-flow.c:453
SCRegisterOnLoggingReady
int SCRegisterOnLoggingReady(SCOnLoggingReadyCallback callback, void *arg)
Register a callback to be called when logging is ready.
Definition: output.c:752
OutputPacketLoggerFunctions_::ConditionFunc
PacketLogCondition ConditionFunc
Definition: output.h:87
TmModuleLoggerRegister
void TmModuleLoggerRegister(void)
Definition: output.c:905
output-json-dcerpc.h
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
JsonPgsqlAddMetadata
bool JsonPgsqlAddMetadata(void *vtx, SCJsonBuilder *jb)
Definition: output-json-pgsql.c:62
OutputJsonRegister
void OutputJsonRegister(void)
Definition: output-json.c:83
OutputClearActiveLoggers
void OutputClearActiveLoggers(void)
Definition: output.c:896
ALPROTO_KRB5
@ ALPROTO_KRB5
Definition: app-layer-protos.h:56
OutputJsonThreadCtx_
Definition: output-json.h:85
TAILQ_ENTRY
#define TAILQ_ENTRY(type)
Definition: queue.h:239
RootLogger_::LogFunc
OutputLogFunc LogFunc
Definition: output.c:87
output-json-dnp3.h
OutputRegisterFileRotationFlag
void OutputRegisterFileRotationFlag(int *flag)
Register a flag for file rotation notification.
Definition: output.c:687
OutputJsonLogInitSub
OutputInitResult OutputJsonLogInitSub(SCConfNode *conf, OutputCtx *parent_ctx)
Definition: output-json-common.c:73
OutputRegisterFlowSubModule
void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a flow output sub-module.
Definition: output.c:490
OutputModule_::stream_type
enum SCOutputStreamingType stream_type
Definition: output.h:77
OutputModule_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.h:64
OutputRegisterTxModuleWithCondition
void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module with condition.
Definition: output.c:344
TAILQ_HEAD_INITIALIZER
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:236
output_modules
OutputModuleList output_modules
JsonAnomalyLogRegister
void JsonAnomalyLogRegister(void)
Definition: output-json-anomaly.c:448
TAILQ_REMOVE
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:312
util-debug.h
output-json-flow.h
TAILQ_FIRST
#define TAILQ_FIRST(head)
Definition: queue.h:250
OutputStreamingLoggerRegister
void OutputStreamingLoggerRegister(void)
Definition: output-streaming.c:432
util-error.h
OutputRegisterStatsModule
void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a stats data output module.
Definition: output.c:565
log-tcp-data.h
g_alproto_max
AppProto g_alproto_max
Definition: app-layer-protos.c:30
OutputModule_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.h:65
ALPROTO_DNP3
@ ALPROTO_DNP3
Definition: app-layer-protos.h:50
output-json.h
SCMutexUnlock
#define SCMutexUnlock(mut)
Definition: threads-debug.h:120
OutputRegisterTxModuleWithProgress
void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module with progress.
Definition: output.c:368
output-json-file.h
OutputRegisterModule
void OutputRegisterModule(const char *, const char *, OutputInitFunc)
JsonIKELogRegister
void JsonIKELogRegister(void)
Definition: output-json-ike.c:182
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
JsonMdnsLogRegister
void JsonMdnsLogRegister(void)
Definition: output-json-mdns.c:155
output-json-llmnr.h
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:43
OutputModule_::StreamingLogFunc
SCStreamingLogger StreamingLogFunc
Definition: output.h:74
OutputLoggerThreadInit
TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
Definition: output.c:797
LOG_DIR_FLOW
@ LOG_DIR_FLOW
Definition: output-eve-bindgen.h:35
app-layer-parser.h
JsonMQTTLogRegister
void JsonMQTTLogRegister(void)
Definition: output-json-mqtt.c:192
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:325
OutputFilestoreRegister
void OutputFilestoreRegister(void)
Definition: output-filestore.c:527
OutputRegisterLoggers
void OutputRegisterLoggers(void)
Register all non-root logging modules.
Definition: output.c:1071
OutputModule_::conf_name
const char * conf_name
Definition: output.h:59
output-json-anomaly.h
OutputModule_::FlowLogFunc
FlowLogger FlowLogFunc
Definition: output.h:73
OutputDeregisterAll
void OutputDeregisterAll(void)
Deregister all modules. Useful for a memory clean exit.
Definition: output.c:653
Packet_
Definition: decode.h:514
RootLogger_::ActiveCntFunc
OutputGetActiveCountFunc ActiveCntFunc
Definition: output.c:90
OutputPacketLoggerRegister
void OutputPacketLoggerRegister(void)
Definition: output-packet.c:192
EveJsonTxLoggerRegistrationData
Definition: output-eve-bindgen.h:49
ALPROTO_RDP
@ ALPROTO_RDP
Definition: app-layer-protos.h:68
conf.h
OutputNotifyFileRotation
void OutputNotifyFileRotation(void)
Notifies all registered file rotation notification flags.
Definition: output.c:730
TAILQ_HEAD
typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_)
Definition: output.c:111
TmEcode
TmEcode
Definition: tm-threads-common.h:80
ALPROTO_DOH2
@ ALPROTO_DOH2
Definition: app-layer-protos.h:66
EveStreamLogRegister
void EveStreamLogRegister(void)
Definition: output-eve-stream.c:453
ALPROTO_TFTP
@ ALPROTO_TFTP
Definition: app-layer-protos.h:54
RootLogger_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.c:88
ALPROTO_HTTP2
@ ALPROTO_HTTP2
Definition: app-layer-protos.h:69
EveJsonSimpleAppLayerLogger
Definition: output-eve-bindgen.h:42
TAILQ_FOREACH_SAFE
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:329
log-pcap.h
SCRealloc
#define SCRealloc(ptr, sz)
Definition: util-mem.h:50
AlertJsonLLMNR
bool AlertJsonLLMNR(void *txptr, SCJsonBuilder *js)
Definition: output-json-llmnr.c:45
alert-fastlog.h
TxLoggerCondition
bool(* TxLoggerCondition)(ThreadVars *, const Packet *, void *state, void *tx, uint64_t tx_id)
Transaction logger condition function pointer type.
Definition: output-tx.h:41
LogStatsLogRegister
void LogStatsLogRegister(void)
Definition: log-stats.c:285
OutputPacketLoggerFunctions_::ThreadDeinitFunc
ThreadDeinitFunc ThreadDeinitFunc
Definition: output.h:89
JsonFrameLogRegister
void JsonFrameLogRegister(void)
Definition: output-json-frame.c:551
cnt
uint32_t cnt
Definition: tmqh-packetpool.h:7
Packet_::flow
struct Flow_ * flow
Definition: decode.h:562
OutputModule_::TxLogCondition
TxLoggerCondition TxLogCondition
Definition: output.h:70
ALPROTO_LLMNR
@ ALPROTO_LLMNR
Definition: app-layer-protos.h:73
suricata-common.h
output-json-stats.h
EveJsonSimpleAppLayerLogger::LogTx
EveJsonSimpleTxLogFunc LogTx
Definition: output-eve-bindgen.h:43
ARRAY_CAP_STEP
#define ARRAY_CAP_STEP
Definition: output.c:1033
output-json-nfs.h
EveJsonSimpleAppLayerLogger::name
const char * name
Definition: output-eve-bindgen.h:44
ALPROTO_PGSQL
@ ALPROTO_PGSQL
Definition: app-layer-protos.h:62
TAILQ_NEXT
#define TAILQ_NEXT(elm, field)
Definition: queue.h:307
OutputPacketLoggerFunctions_::LogFunc
PacketLogger LogFunc
Definition: output.h:86
OutputRegisterPacketModule
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
Register a packet output module.
Definition: output.c:193
ALPROTO_FTPDATA
@ ALPROTO_FTPDATA
Definition: app-layer-protos.h:53
output-filestore.h
output-json-mdns.h
FatalError
#define FatalError(...)
Definition: util-debug.h:517
LuaLogRegister
void LuaLogRegister(void)
Definition: output-lua.c:939
ALPROTO_WEBSOCKET
@ ALPROTO_WEBSOCKET
Definition: app-layer-protos.h:64
OutputRegisterPacketSubModule
void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, OutputPacketLoggerFunctions *output_logger_functions)
Register a packet output sub-module.
Definition: output.c:230
JsonSmtpLogRegister
void JsonSmtpLogRegister(void)
Definition: output-json-smtp.c:192
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:33
JsonMetadataLogRegister
void JsonMetadataLogRegister(void)
Definition: output-json-metadata.c:95
output-json-alert.h
OutputModule_::PacketConditionFunc
PacketLogCondition PacketConditionFunc
Definition: output.h:68
RootLogger
struct RootLogger_ RootLogger
output-json-dns.h
OutputGetActiveCountFunc
uint32_t(* OutputGetActiveCountFunc)(void)
Definition: output.h:54
OutputPacketLoggerFunctions_::ThreadInitFunc
ThreadInitFunc ThreadInitFunc
Definition: output.h:88
output-json-metadata.h
LOGGER_JSON_TX
@ LOGGER_JSON_TX
Definition: suricata-common.h:492
JsonDnsLogRegister
void JsonDnsLogRegister(void)
Definition: output-json-dns.c:688
output-eve.h
EVE logging subsystem.
EveFTPLogCommand
bool EveFTPLogCommand(void *vtx, SCJsonBuilder *jb)
Definition: output-json-ftp.c:49
SCConfGetNode
SCConfNode * SCConfGetNode(const char *name)
Get a SCConfNode by name.
Definition: conf.c:182
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:274
OutputLoggerLog
TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
Definition: output.c:783
SCFree
#define SCFree(p)
Definition: util-mem.h:61
output-json-dhcp.h
ALPROTO_MDNS
@ ALPROTO_MDNS
Definition: app-layer-protos.h:72
JsonDropLogRegister
void JsonDropLogRegister(void)
Definition: output-json-drop.c:392
output-json-ike.h
StatsLogger
int(* StatsLogger)(ThreadVars *, void *thread_data, const StatsTable *)
Definition: output-stats.h:50
OutputModule_::TxLogFunc
TxLogger TxLogFunc
Definition: output.h:69
ALPROTO_MQTT
@ ALPROTO_MQTT
Definition: app-layer-protos.h:61
OutputModule_::tc_log_progress
int tc_log_progress
Definition: output.h:78
OnLoggingReadyCallbackNode
OnLoggingReadyCallbackNode
Definition: output.c:146
AlertJsonDnp3
bool AlertJsonDnp3(void *vtx, SCJsonBuilder *js)
Definition: output-json-dnp3.c:197
ALPROTO_TEMPLATE
@ ALPROTO_TEMPLATE
Definition: app-layer-protos.h:67
output-lua.h
SCOnLoggingReady
void SCOnLoggingReady(void)
Invokes all registered logging ready callbacks.
Definition: output.c:773
ALPROTO_RFB
@ ALPROTO_RFB
Definition: app-layer-protos.h:60
LOG_DIR_PACKET
@ LOG_DIR_PACKET
Definition: output-eve-bindgen.h:34
JsonHttpLogRegister
void JsonHttpLogRegister(void)
Definition: output-json-http.c:637
ALPROTO_BITTORRENT_DHT
@ ALPROTO_BITTORRENT_DHT
Definition: app-layer-protos.h:70
output-json-smb.h
JsonArpLogRegister
void JsonArpLogRegister(void)
Definition: output-json-arp.c:104
SCOutputStreamingType
SCOutputStreamingType
Definition: output-streaming.h:35
AlertJsonMdns
bool AlertJsonMdns(void *txptr, SCJsonBuilder *js)
Definition: output-json-mdns.c:42
output-json-smtp.h
JsonLogThreadDeinit
TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
Definition: output-json-common.c:123
output-json-http.h
flow.h
OutputModule_
Definition: output.h:56
AlertDebugLogRegister
void AlertDebugLogRegister(void)
Definition: alert-debuglog.c:485
OutputUnregisterFileRotationFlag
void OutputUnregisterFileRotationFlag(int *flag)
Unregister a file rotation flag.
Definition: output.c:710
OutputRegisterTxSubModuleWithCondition
void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Definition: output.c:352
log-tlsstore.h
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:450
EveJsonSimpleTxLogFunc
bool(* EveJsonSimpleTxLogFunc)(const void *, void *)
Definition: output-eve-bindgen.h:40
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
OutputFiledataLoggerRegister
void OutputFiledataLoggerRegister(void)
Definition: output-filedata.c:269
AlertJsonDoh2
bool AlertJsonDoh2(void *txptr, SCJsonBuilder *js)
Definition: output-json-dns.c:258
OutputPacketLoggerFunctions_
Definition: output.h:85
SCMutex
#define SCMutex
Definition: threads-debug.h:114
OutputInitSubFunc
OutputInitResult(* OutputInitSubFunc)(SCConfNode *, OutputCtx *)
Definition: output.h:52
SCStreamingLogger
int(* SCStreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
Definition: output-streaming.h:41
output.h
JsonAlertLogRegister
void JsonAlertLogRegister(void)
Definition: output-json-alert.c:1153
JsonNFSLogRegister
void JsonNFSLogRegister(void)
Definition: output-json-nfs.c:109
OutputDropLoggerDisable
void OutputDropLoggerDisable(void)
Definition: output.c:675
JsonNetFlowLogRegister
void JsonNetFlowLogRegister(void)
Definition: output-json-netflow.c:314
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:44
OutputModule_::InitFunc
OutputInitFunc InitFunc
Definition: output.h:61
RootLogger_
Definition: output.c:86
output-json-drop.h