suricata
output.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2021 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 
43 #include "alert-fastlog.h"
44 #include "alert-debuglog.h"
45 #include "alert-syslog.h"
46 #include "output-json.h"
47 #include "output-json-alert.h"
48 #include "output-json-anomaly.h"
49 #include "output-json-flow.h"
50 #include "output-json-netflow.h"
51 #include "log-cf-common.h"
52 #include "output-json-drop.h"
53 #include "output-eve-stream.h"
54 #include "log-httplog.h"
55 #include "output-json-http.h"
56 #include "output-json-dns.h"
57 #include "log-tlslog.h"
58 #include "log-tlsstore.h"
59 #include "output-json-tls.h"
60 #include "log-pcap.h"
61 // for SSHTxLogCondition
62 #include "app-layer-ssh.h"
63 #include "output-json-file.h"
64 #include "output-json-smtp.h"
65 #include "output-json-stats.h"
66 #include "log-tcp-data.h"
67 #include "log-stats.h"
68 #include "output-json-nfs.h"
69 #include "output-json-ftp.h"
70 // for misplaced EveFTPDataAddMetadata
71 #include "app-layer-ftp.h"
72 #include "output-json-smb.h"
73 #include "output-json-ike.h"
74 #include "output-json-dhcp.h"
75 #include "output-json-mqtt.h"
76 #include "output-json-pgsql.h"
77 #include "output-lua.h"
78 #include "output-json-dnp3.h"
79 #include "output-json-metadata.h"
80 #include "output-json-dcerpc.h"
81 #include "output-json-frame.h"
82 #include "app-layer-parser.h"
83 #include "output-filestore.h"
84 #include "output-json-arp.h"
85 
86 typedef struct RootLogger_ {
92 
93  TAILQ_ENTRY(RootLogger_) entries;
95 
96 /* List of registered root loggers. These are registered at start up and
97  * are independent of configuration. Later we will build a list of active
98  * loggers based on configuration. */
99 static TAILQ_HEAD(, RootLogger_) registered_loggers =
100  TAILQ_HEAD_INITIALIZER(registered_loggers);
101 
102 /* List of active root loggers. This means that at least one logger is enabled
103  * for each root logger type in the config. */
104 static TAILQ_HEAD(, RootLogger_) active_loggers =
105  TAILQ_HEAD_INITIALIZER(active_loggers);
106 
107 typedef struct LoggerThreadStoreNode_ {
108  void *thread_data;
109  TAILQ_ENTRY(LoggerThreadStoreNode_) entries;
111 
112 typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_) LoggerThreadStore;
113 
114 /**
115  * The list of all registered (known) output modules.
116  */
118 
119 /**
120  * Registry of flags to be updated on file rotation notification.
121  */
122 typedef struct OutputFileRolloverFlag_ {
123  int *flag;
124 
125  TAILQ_ENTRY(OutputFileRolloverFlag_) entries;
127 
128 TAILQ_HEAD(, OutputFileRolloverFlag_) output_file_rotation_flags =
129  TAILQ_HEAD_INITIALIZER(output_file_rotation_flags);
130 
131 void OutputRegisterRootLoggers(void);
132 void OutputRegisterLoggers(void);
133 
134 /**
135  * \brief Register an output module.
136  *
137  * This function will register an output module so it can be
138  * configured with the configuration file.
139  *
140  * \retval Returns 0 on success, -1 on failure.
141  */
142 void OutputRegisterModule(const char *name, const char *conf_name,
143  OutputInitFunc InitFunc)
144 {
145  OutputModule *module = SCCalloc(1, sizeof(*module));
146  if (unlikely(module == NULL))
147  goto error;
148 
149  module->name = name;
150  module->conf_name = conf_name;
151  module->InitFunc = InitFunc;
152  TAILQ_INSERT_TAIL(&output_modules, module, entries);
153 
154  SCLogDebug("Output module \"%s\" registered.", name);
155 
156  return;
157 
158 error:
159  FatalError("Fatal error encountered in OutputRegisterModule. Exiting...");
160 }
161 
162 /**
163  * \brief Register a packet output module.
164  *
165  * This function will register an output module so it can be
166  * configured with the configuration file.
167  *
168  * \retval Returns 0 on success, -1 on failure.
169  */
170 void OutputRegisterPacketModule(LoggerId id, const char *name,
171  const char *conf_name, OutputInitFunc InitFunc,
172  PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc,
173  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
174  ThreadExitPrintStatsFunc ThreadExitPrintStats)
175 {
176  if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
177  goto error;
178  }
179 
180  OutputModule *module = SCCalloc(1, sizeof(*module));
181  if (unlikely(module == NULL)) {
182  goto error;
183  }
184 
185  module->logger_id = id;
186  module->name = name;
187  module->conf_name = conf_name;
188  module->InitFunc = InitFunc;
189  module->PacketLogFunc = PacketLogFunc;
190  module->PacketConditionFunc = PacketConditionFunc;
191  module->ThreadInit = ThreadInit;
192  module->ThreadDeinit = ThreadDeinit;
193  module->ThreadExitPrintStats = ThreadExitPrintStats;
194  TAILQ_INSERT_TAIL(&output_modules, module, entries);
195 
196  SCLogDebug("Packet logger \"%s\" registered.", name);
197  return;
198 error:
199  FatalError("Fatal error encountered. Exiting...");
200 }
201 
202 /**
203  * \brief Register a packet output sub-module.
204  *
205  * This function will register an output module so it can be
206  * configured with the configuration file.
207  *
208  * \retval Returns 0 on success, -1 on failure.
209  */
210 void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name,
211  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
212  PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc,
213  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
214  ThreadExitPrintStatsFunc ThreadExitPrintStats)
215 {
216  if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
217  goto error;
218  }
219 
220  OutputModule *module = SCCalloc(1, sizeof(*module));
221  if (unlikely(module == NULL)) {
222  goto error;
223  }
224 
225  module->logger_id = id;
226  module->name = name;
227  module->conf_name = conf_name;
228  module->parent_name = parent_name;
229  module->InitSubFunc = InitFunc;
230  module->PacketLogFunc = PacketLogFunc;
231  module->PacketConditionFunc = PacketConditionFunc;
232  module->ThreadInit = ThreadInit;
233  module->ThreadDeinit = ThreadDeinit;
234  module->ThreadExitPrintStats = ThreadExitPrintStats;
235  TAILQ_INSERT_TAIL(&output_modules, module, entries);
236 
237  SCLogDebug("Packet logger \"%s\" registered.", name);
238  return;
239 error:
240  FatalError("Fatal error encountered. Exiting...");
241 }
242 
243 /**
244  * \brief Wrapper function for tx output modules.
245  *
246  * This function will register an output module so it can be
247  * configured with the configuration file.
248  *
249  * \retval Returns 0 on success, -1 on failure.
250  */
251 static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name,
252  const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
253  TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
254  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
255  ThreadDeinitFunc ThreadDeinit,
256  ThreadExitPrintStatsFunc ThreadExitPrintStats)
257 {
258  if (unlikely(TxLogFunc == NULL)) {
259  goto error;
260  }
261 
262  OutputModule *module = SCCalloc(1, sizeof(*module));
263  if (unlikely(module == NULL)) {
264  goto error;
265  }
266 
267  module->logger_id = id;
268  module->name = name;
269  module->conf_name = conf_name;
270  module->InitFunc = InitFunc;
271  module->TxLogFunc = TxLogFunc;
272  module->TxLogCondition = TxLogCondition;
273  module->alproto = alproto;
274  module->tc_log_progress = tc_log_progress;
275  module->ts_log_progress = ts_log_progress;
276  module->ThreadInit = ThreadInit;
277  module->ThreadDeinit = ThreadDeinit;
278  module->ThreadExitPrintStats = ThreadExitPrintStats;
279  TAILQ_INSERT_TAIL(&output_modules, module, entries);
280 
281  SCLogDebug("Tx logger \"%s\" registered.", name);
282  return;
283 error:
284  FatalError("Fatal error encountered. Exiting...");
285 }
286 
287 static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name,
288  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
289  AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
290  int ts_log_progress, TxLoggerCondition TxLogCondition,
291  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
292  ThreadExitPrintStatsFunc ThreadExitPrintStats)
293 {
294  if (unlikely(TxLogFunc == NULL)) {
295  goto error;
296  }
297 
298  OutputModule *module = SCCalloc(1, sizeof(*module));
299  if (unlikely(module == NULL)) {
300  goto error;
301  }
302 
303  module->logger_id = id;
304  module->name = name;
305  module->conf_name = conf_name;
306  module->parent_name = parent_name;
307  module->InitSubFunc = InitFunc;
308  module->TxLogFunc = TxLogFunc;
309  module->TxLogCondition = TxLogCondition;
310  module->alproto = alproto;
311  module->tc_log_progress = tc_log_progress;
312  module->ts_log_progress = ts_log_progress;
313  module->ThreadInit = ThreadInit;
314  module->ThreadDeinit = ThreadDeinit;
315  module->ThreadExitPrintStats = ThreadExitPrintStats;
316  TAILQ_INSERT_TAIL(&output_modules, module, entries);
317 
318  SCLogDebug("Tx logger for alproto %d \"%s\" registered.", alproto, name);
319  return;
320 error:
321  FatalError("Fatal error encountered. Exiting...");
322 }
323 
324 /**
325  * \brief Register a tx output module with condition.
326  *
327  * This function will register an output module so it can be
328  * configured with the configuration file.
329  *
330  * \retval Returns 0 on success, -1 on failure.
331  */
333  const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
334  TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
335  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
336  ThreadExitPrintStatsFunc ThreadExitPrintStats)
337 {
338  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
339  TxLogFunc, -1, -1, TxLogCondition, ThreadInit, ThreadDeinit,
340  ThreadExitPrintStats);
341 }
342 
344  const char *parent_name, const char *name, const char *conf_name,
345  OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
346  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
347  ThreadDeinitFunc ThreadDeinit,
348  ThreadExitPrintStatsFunc ThreadExitPrintStats)
349 {
350  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc,
351  alproto, TxLogFunc, -1, -1, TxLogCondition, ThreadInit, ThreadDeinit,
352  ThreadExitPrintStats);
353 }
354 
355 /**
356  * \brief Register a tx output module with progress.
357  *
358  * This function will register an output module so it can be
359  * configured with the configuration file.
360  *
361  * \retval Returns 0 on success, -1 on failure.
362  */
364  const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
365  TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
366  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
367  ThreadExitPrintStatsFunc ThreadExitPrintStats)
368 {
369  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
370  TxLogFunc, tc_log_progress, ts_log_progress, NULL, ThreadInit,
371  ThreadDeinit, ThreadExitPrintStats);
372 }
373 
374 void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
375  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
376  AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
377  int ts_log_progress, ThreadInitFunc ThreadInit,
378  ThreadDeinitFunc ThreadDeinit,
379  ThreadExitPrintStatsFunc ThreadExitPrintStats)
380 {
381  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc,
382  alproto, TxLogFunc, tc_log_progress, ts_log_progress, NULL, ThreadInit,
383  ThreadDeinit, ThreadExitPrintStats);
384 }
385 
386 /**
387  * \brief Register a tx output module.
388  *
389  * This function will register an output module so it can be
390  * configured with the configuration file.
391  *
392  * \retval Returns 0 on success, -1 on failure.
393  */
394 void OutputRegisterTxModule(LoggerId id, const char *name,
395  const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
396  TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
397  ThreadDeinitFunc ThreadDeinit,
398  ThreadExitPrintStatsFunc ThreadExitPrintStats)
399 {
400  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
401  TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
402  ThreadExitPrintStats);
403 }
404 
405 void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
406  const char *name, const char *conf_name,
407  OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
408  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
409  ThreadExitPrintStatsFunc ThreadExitPrintStats)
410 {
411  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name,
412  InitFunc, alproto, TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
413  ThreadExitPrintStats);
414 }
415 
416 /**
417  * \brief Register a file output sub-module.
418  *
419  * This function will register an output module so it can be
420  * configured with the configuration file.
421  *
422  * \retval Returns 0 on success, -1 on failure.
423  */
424 void OutputRegisterFileSubModule(LoggerId id, const char *parent_name,
425  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
426  FileLogger FileLogFunc, ThreadInitFunc ThreadInit,
427  ThreadDeinitFunc ThreadDeinit,
428  ThreadExitPrintStatsFunc ThreadExitPrintStats)
429 {
430  if (unlikely(FileLogFunc == NULL)) {
431  goto error;
432  }
433 
434  OutputModule *module = SCCalloc(1, sizeof(*module));
435  if (unlikely(module == NULL)) {
436  goto error;
437  }
438 
439  module->logger_id = id;
440  module->name = name;
441  module->conf_name = conf_name;
442  module->parent_name = parent_name;
443  module->InitSubFunc = InitFunc;
444  module->FileLogFunc = FileLogFunc;
445  module->ThreadInit = ThreadInit;
446  module->ThreadDeinit = ThreadDeinit;
447  module->ThreadExitPrintStats = ThreadExitPrintStats;
448  TAILQ_INSERT_TAIL(&output_modules, module, entries);
449 
450  SCLogDebug("File logger \"%s\" registered.", name);
451  return;
452 error:
453  FatalError("Fatal error encountered. Exiting...");
454 }
455 
456 /**
457  * \brief Register a file data output module.
458  *
459  * This function will register an output module so it can be
460  * configured with the configuration file.
461  *
462  * \retval Returns 0 on success, -1 on failure.
463  */
464 void OutputRegisterFiledataModule(LoggerId id, const char *name,
465  const char *conf_name, OutputInitFunc InitFunc,
466  FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
467  ThreadDeinitFunc ThreadDeinit,
468  ThreadExitPrintStatsFunc ThreadExitPrintStats)
469 {
470  if (unlikely(FiledataLogFunc == NULL)) {
471  goto error;
472  }
473 
474  OutputModule *module = SCCalloc(1, sizeof(*module));
475  if (unlikely(module == NULL)) {
476  goto error;
477  }
478 
479  module->logger_id = id;
480  module->name = name;
481  module->conf_name = conf_name;
482  module->InitFunc = InitFunc;
483  module->FiledataLogFunc = FiledataLogFunc;
484  module->ThreadInit = ThreadInit;
485  module->ThreadDeinit = ThreadDeinit;
486  module->ThreadExitPrintStats = ThreadExitPrintStats;
487  TAILQ_INSERT_TAIL(&output_modules, module, entries);
488 
489  SCLogDebug("Filedata logger \"%s\" registered.", name);
490  return;
491 error:
492  FatalError("Fatal error encountered. Exiting...");
493 }
494 
495 /**
496  * \brief Register a flow output sub-module.
497  *
498  * This function will register an output module so it can be
499  * configured with the configuration file.
500  *
501  * \retval Returns 0 on success, -1 on failure.
502  */
503 void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name,
504  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
505  FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit,
506  ThreadDeinitFunc ThreadDeinit,
507  ThreadExitPrintStatsFunc ThreadExitPrintStats)
508 {
509  if (unlikely(FlowLogFunc == NULL)) {
510  goto error;
511  }
512 
513  OutputModule *module = SCCalloc(1, sizeof(*module));
514  if (unlikely(module == NULL)) {
515  goto error;
516  }
517 
518  module->logger_id = id;
519  module->name = name;
520  module->conf_name = conf_name;
521  module->parent_name = parent_name;
522  module->InitSubFunc = InitFunc;
523  module->FlowLogFunc = FlowLogFunc;
524  module->ThreadInit = ThreadInit;
525  module->ThreadDeinit = ThreadDeinit;
526  module->ThreadExitPrintStats = ThreadExitPrintStats;
527  TAILQ_INSERT_TAIL(&output_modules, module, entries);
528 
529  SCLogDebug("Flow logger \"%s\" registered.", name);
530  return;
531 error:
532  FatalError("Fatal error encountered. Exiting...");
533 }
534 
535 /**
536  * \brief Register a streaming data output module.
537  *
538  * This function will register an output module so it can be
539  * configured with the configuration file.
540  *
541  * \retval Returns 0 on success, -1 on failure.
542  */
543 void OutputRegisterStreamingModule(LoggerId id, const char *name,
544  const char *conf_name, OutputInitFunc InitFunc,
545  StreamingLogger StreamingLogFunc,
546  enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
547  ThreadDeinitFunc ThreadDeinit,
548  ThreadExitPrintStatsFunc ThreadExitPrintStats)
549 {
550  if (unlikely(StreamingLogFunc == NULL)) {
551  goto error;
552  }
553 
554  OutputModule *module = SCCalloc(1, sizeof(*module));
555  if (unlikely(module == NULL)) {
556  goto error;
557  }
558 
559  module->logger_id = id;
560  module->name = name;
561  module->conf_name = conf_name;
562  module->InitFunc = InitFunc;
563  module->StreamingLogFunc = StreamingLogFunc;
564  module->stream_type = stream_type;
565  module->ThreadInit = ThreadInit;
566  module->ThreadDeinit = ThreadDeinit;
567  module->ThreadExitPrintStats = ThreadExitPrintStats;
568  TAILQ_INSERT_TAIL(&output_modules, module, entries);
569 
570  SCLogDebug("Streaming logger \"%s\" registered.", name);
571  return;
572 error:
573  FatalError("Fatal error encountered. Exiting...");
574 }
575 
576 /**
577  * \brief Register a stats data output module.
578  *
579  * This function will register an output module so it can be
580  * configured with the configuration file.
581  *
582  * \retval Returns 0 on success, -1 on failure.
583  */
584 void OutputRegisterStatsModule(LoggerId id, const char *name,
585  const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc,
586  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
587  ThreadExitPrintStatsFunc ThreadExitPrintStats)
588 {
589  if (unlikely(StatsLogFunc == NULL)) {
590  goto error;
591  }
592 
593  OutputModule *module = SCCalloc(1, sizeof(*module));
594  if (unlikely(module == NULL)) {
595  goto error;
596  }
597 
598  module->logger_id = id;
599  module->name = name;
600  module->conf_name = conf_name;
601  module->InitFunc = InitFunc;
602  module->StatsLogFunc = StatsLogFunc;
603  module->ThreadInit = ThreadInit;
604  module->ThreadDeinit = ThreadDeinit;
605  module->ThreadExitPrintStats = ThreadExitPrintStats;
606  TAILQ_INSERT_TAIL(&output_modules, module, entries);
607 
608  SCLogDebug("Stats logger \"%s\" registered.", name);
609  return;
610 error:
611  FatalError("Fatal error encountered. Exiting...");
612 }
613 
614 /**
615  * \brief Register a stats data output sub-module.
616  *
617  * This function will register an output module so it can be
618  * configured with the configuration file.
619  *
620  * \retval Returns 0 on success, -1 on failure.
621  */
622 void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name,
623  const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
624  StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
625  ThreadDeinitFunc ThreadDeinit,
626  ThreadExitPrintStatsFunc ThreadExitPrintStats)
627 {
628  if (unlikely(StatsLogFunc == NULL)) {
629  goto error;
630  }
631 
632  OutputModule *module = SCCalloc(1, sizeof(*module));
633  if (unlikely(module == NULL)) {
634  goto error;
635  }
636 
637  module->logger_id = id;
638  module->name = name;
639  module->conf_name = conf_name;
640  module->parent_name = parent_name;
641  module->InitSubFunc = InitFunc;
642  module->StatsLogFunc = StatsLogFunc;
643  module->ThreadInit = ThreadInit;
644  module->ThreadDeinit = ThreadDeinit;
645  module->ThreadExitPrintStats = ThreadExitPrintStats;
646  TAILQ_INSERT_TAIL(&output_modules, module, entries);
647 
648  SCLogDebug("Stats logger \"%s\" registered.", name);
649  return;
650 error:
651  FatalError("Fatal error encountered. Exiting...");
652 }
653 
654 /**
655  * \brief Get an output module by name.
656  *
657  * \retval The OutputModule with the given name or NULL if no output module
658  * with the given name is registered.
659  */
661 {
662  OutputModule *module;
663 
664  TAILQ_FOREACH(module, &output_modules, entries) {
665  if (strcmp(module->conf_name, conf_name) == 0)
666  return module;
667  }
668 
669  return NULL;
670 }
671 
672 /**
673  * \brief Deregister all modules. Useful for a memory clean exit.
674  */
676 {
677  OutputModule *module;
678 
679  while ((module = TAILQ_FIRST(&output_modules))) {
680  TAILQ_REMOVE(&output_modules, module, entries);
681  SCFree(module);
682  }
683 }
684 
685 static int drop_loggers = 0;
686 
688 {
689  if (drop_loggers)
690  return -1;
691  drop_loggers++;
692  return 0;
693 }
694 
696 {
697  if (drop_loggers)
698  drop_loggers--;
699 }
700 
701 /**
702  * \brief Register a flag for file rotation notification.
703  *
704  * \param flag A pointer that will be set to 1 when file rotation is
705  * requested.
706  */
708 {
709  OutputFileRolloverFlag *flag_entry = SCCalloc(1, sizeof(*flag_entry));
710  if (unlikely(flag_entry == NULL)) {
711  SCLogError("Failed to allocate memory to register file rotation flag");
712  return;
713  }
714  flag_entry->flag = flag;
715  TAILQ_INSERT_TAIL(&output_file_rotation_flags, flag_entry, entries);
716 }
717 
718 /**
719  * \brief Unregister a file rotation flag.
720  *
721  * Note that it is safe to call this function with a flag that may not
722  * have been registered, in which case this function won't do
723  * anything.
724  *
725  * \param flag A pointer that has been previously registered for file
726  * rotation notifications.
727  */
729 {
730  OutputFileRolloverFlag *entry, *next;
731  for (entry = TAILQ_FIRST(&output_file_rotation_flags); entry != NULL;
732  entry = next) {
733  next = TAILQ_NEXT(entry, entries);
734  if (entry->flag == flag) {
735  TAILQ_REMOVE(&output_file_rotation_flags, entry, entries);
736  SCFree(entry);
737  break;
738  }
739  }
740 }
741 
742 /**
743  * \brief Notifies all registered file rotation notification flags.
744  */
747  TAILQ_FOREACH(flag, &output_file_rotation_flags, entries) {
748  *(flag->flag) = 1;
749  }
750 }
751 
752 TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
753 {
754  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
755  RootLogger *logger = TAILQ_FIRST(&active_loggers);
756  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
757  while (logger && thread_store_node) {
758  logger->LogFunc(tv, p, thread_store_node->thread_data);
759 
760  logger = TAILQ_NEXT(logger, entries);
761  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
762  }
763  return TM_ECODE_OK;
764 }
765 
766 TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
767 {
768  LoggerThreadStore *thread_store = SCCalloc(1, sizeof(*thread_store));
769  if (thread_store == NULL) {
770  return TM_ECODE_FAILED;
771  }
772  TAILQ_INIT(thread_store);
773  *data = (void *)thread_store;
774 
775  RootLogger *logger;
776  TAILQ_FOREACH(logger, &active_loggers, entries) {
777 
778  void *child_thread_data = NULL;
779  if (logger->ThreadInit != NULL) {
780  if (logger->ThreadInit(tv, initdata, &child_thread_data) == TM_ECODE_OK) {
781  LoggerThreadStoreNode *thread_store_node =
782  SCCalloc(1, sizeof(*thread_store_node));
783  if (thread_store_node == NULL) {
784  /* Undo everything, calling de-init will take care
785  * of that. */
786  OutputLoggerThreadDeinit(tv, thread_store);
787  return TM_ECODE_FAILED;
788  }
789  thread_store_node->thread_data = child_thread_data;
790  TAILQ_INSERT_TAIL(thread_store, thread_store_node, entries);
791  }
792  }
793  }
794  return TM_ECODE_OK;
795 }
796 
798 {
799  if (thread_data == NULL)
800  return TM_ECODE_FAILED;
801 
802  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
803  RootLogger *logger = TAILQ_FIRST(&active_loggers);
804  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
805  while (logger && thread_store_node) {
806  if (logger->ThreadDeinit != NULL) {
807  logger->ThreadDeinit(tv, thread_store_node->thread_data);
808  }
809  logger = TAILQ_NEXT(logger, entries);
810  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
811  }
812 
813  /* Free the thread store. */
814  while ((thread_store_node = TAILQ_FIRST(thread_store)) != NULL) {
815  TAILQ_REMOVE(thread_store, thread_store_node, entries);
816  SCFree(thread_store_node);
817  }
818  SCFree(thread_store);
819 
820  return TM_ECODE_OK;
821 }
822 
823 void OutputLoggerExitPrintStats(ThreadVars *tv, void *thread_data)
824 {
825  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
826  RootLogger *logger = TAILQ_FIRST(&active_loggers);
827  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
828  while (logger && thread_store_node) {
829  if (logger->ThreadExitPrintStats != NULL) {
830  logger->ThreadExitPrintStats(tv, thread_store_node->thread_data);
831  }
832  logger = TAILQ_NEXT(logger, entries);
833  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
834  }
835 }
836 
838  ThreadDeinitFunc ThreadDeinit,
839  ThreadExitPrintStatsFunc ThreadExitPrintStats,
840  OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
841 {
842  BUG_ON(LogFunc == NULL);
843 
844  RootLogger *logger = SCCalloc(1, sizeof(*logger));
845  if (logger == NULL) {
846  FatalError("failed to alloc root logger");
847  }
848  logger->ThreadInit = ThreadInit;
849  logger->ThreadDeinit = ThreadDeinit;
850  logger->ThreadExitPrintStats = ThreadExitPrintStats;
851  logger->LogFunc = LogFunc;
852  logger->ActiveCntFunc = ActiveCntFunc;
853  TAILQ_INSERT_TAIL(&registered_loggers, logger, entries);
854 }
855 
856 static void OutputRegisterActiveLogger(RootLogger *reg)
857 {
858  RootLogger *logger = SCCalloc(1, sizeof(*logger));
859  if (logger == NULL) {
860  FatalError("failed to alloc root logger");
861  }
862  logger->ThreadInit = reg->ThreadInit;
863  logger->ThreadDeinit = reg->ThreadDeinit;
865  logger->LogFunc = reg->LogFunc;
866  logger->ActiveCntFunc = reg->ActiveCntFunc;
867  TAILQ_INSERT_TAIL(&active_loggers, logger, entries);
868 }
869 
871 {
872  RootLogger *logger = TAILQ_FIRST(&registered_loggers);
873  while (logger) {
874  uint32_t cnt = logger->ActiveCntFunc();
875  if (cnt) {
876  OutputRegisterActiveLogger(logger);
877  }
878 
879  logger = TAILQ_NEXT(logger, entries);
880  }
881 }
882 
884 {
885  RootLogger *logger;
886  while ((logger = TAILQ_FIRST(&active_loggers)) != NULL) {
887  TAILQ_REMOVE(&active_loggers, logger, entries);
888  SCFree(logger);
889  }
890 }
891 
893 {
896 }
897 
898 /**
899  * \brief Register all root loggers.
900  */
902 {
908 }
909 
910 static int JsonGenericLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
911  void *state, void *tx, uint64_t tx_id, int dir)
912 {
913  OutputJsonThreadCtx *thread = thread_data;
915  if (al == NULL) {
916  return TM_ECODE_FAILED;
917  }
918 
919  const char *name;
920  switch (al->proto) {
921  case ALPROTO_HTTP2:
922  // special case
923  name = "http";
924  break;
925  case ALPROTO_FTPDATA:
926  // underscore instead of dash
927  name = "ftp_data";
928  break;
930  // underscore instead of dash
931  name = "bittorrent_dht";
932  break;
933  default:
934  name = AppProtoToString(al->proto);
935  }
936  JsonBuilder *js = CreateEveHeader(p, dir, name, NULL, thread->ctx);
937  if (unlikely(js == NULL)) {
938  return TM_ECODE_FAILED;
939  }
940 
941  if (!al->LogTx(tx, js)) {
942  goto error;
943  }
944 
945  OutputJsonBuilderBuffer(js, thread);
946  jb_free(js);
947 
948  return TM_ECODE_OK;
949 
950 error:
951  jb_free(js);
952  return TM_ECODE_FAILED;
953 }
954 
955 static int JsonGenericDirPacketLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
956  void *state, void *tx, uint64_t tx_id)
957 {
958  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_PACKET);
959 }
960 
961 static int JsonGenericDirFlowLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
962  void *state, void *tx, uint64_t tx_id)
963 {
964  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_FLOW);
965 }
966 
967 /**
968  * \brief Register all non-root logging modules.
969  */
971 {
972  /* custom format log*/
974 
975  LuaLogRegister();
976  /* fast log */
978  /* debug log */
980  /* syslog log */
984  /* json log */
986  /* email logs */
988  /* http log */
991  OutputRegisterTxSubModuleWithProgress(LOGGER_JSON_TX, "eve-log", "LogHttp2Log", "eve-log.http2",
992  OutputJsonLogInitSub, ALPROTO_HTTP2, JsonGenericDirFlowLogger, HTTP2StateClosed,
993  HTTP2StateClosed, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
994  /* tls log */
998  /* ssh */
999  OutputRegisterTxSubModuleWithCondition(LOGGER_JSON_TX, "eve-log", "JsonSshLog", "eve-log.ssh",
1000  OutputJsonLogInitSub, ALPROTO_SSH, JsonGenericDirFlowLogger, SSHTxLogCondition,
1002  /* pcap log */
1003  PcapLogRegister();
1004  /* file log */
1007  /* dns */
1009  /* modbus */
1010  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonModbusLog", "eve-log.modbus",
1011  OutputJsonLogInitSub, ALPROTO_MODBUS, JsonGenericDirFlowLogger, JsonLogThreadInit,
1012  JsonLogThreadDeinit, NULL);
1013 
1014  SCLogDebug("modbus json logger registered.");
1015  /* tcp streaming data */
1017  /* log stats */
1019 
1022  /* flow/netflow */
1025  /* json stats */
1027 
1028  /* DNP3. */
1031 
1032  /* NFS JSON logger. */
1034  /* TFTP JSON logger. */
1035  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTFTPLog", "eve-log.tftp",
1036  OutputJsonLogInitSub, ALPROTO_TFTP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1037  JsonLogThreadDeinit, NULL);
1038 
1039  SCLogDebug("TFTP JSON logger registered.");
1040  /* FTP and FTP-DATA JSON loggers. */
1041  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1042  OutputJsonLogInitSub, ALPROTO_FTP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1043  JsonLogThreadDeinit, NULL);
1044  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1045  OutputJsonLogInitSub, ALPROTO_FTPDATA, JsonGenericDirFlowLogger, JsonLogThreadInit,
1046  JsonLogThreadDeinit, NULL);
1047  SCLogDebug("FTP JSON logger registered.");
1048 
1049  /* SMB JSON logger. */
1051  /* IKE JSON logger. */
1053  /* KRB5 JSON logger. */
1054  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonKRB5Log", "eve-log.krb5",
1055  OutputJsonLogInitSub, ALPROTO_KRB5, JsonGenericDirPacketLogger, JsonLogThreadInit,
1056  JsonLogThreadDeinit, NULL);
1057 
1058  SCLogDebug("KRB5 JSON logger registered.");
1059  /* QUIC JSON logger. */
1060  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonQuicLog", "eve-log.quic",
1061  OutputJsonLogInitSub, ALPROTO_QUIC, JsonGenericDirPacketLogger, JsonLogThreadInit,
1062  JsonLogThreadDeinit, NULL);
1063 
1064  SCLogDebug("quic json logger registered.");
1065  /* DHCP JSON logger. */
1067  /* SNMP JSON logger. */
1068  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSNMPLog", "eve-log.snmp",
1069  OutputJsonLogInitSub, ALPROTO_SNMP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1070  JsonLogThreadDeinit, NULL);
1071 
1072  SCLogDebug("SNMP JSON logger registered.");
1073  /* SIP JSON logger. */
1074  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSIPLog", "eve-log.sip",
1075  OutputJsonLogInitSub, ALPROTO_SIP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1076  JsonLogThreadDeinit, NULL);
1077 
1078  SCLogDebug("SIP JSON logger registered.");
1079  /* RFB JSON logger. */
1080  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRFBLog", "eve-log.rfb",
1081  OutputJsonLogInitSub, ALPROTO_RFB, JsonGenericDirPacketLogger, JsonLogThreadInit,
1082  JsonLogThreadDeinit, NULL);
1083  /* MQTT JSON logger. */
1085  /* Pgsql JSON logger. */
1087  /* WebSocket JSON logger. */
1088  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonWebSocketLog", "eve-log.websocket",
1089  OutputJsonLogInitSub, ALPROTO_WEBSOCKET, JsonGenericDirPacketLogger, JsonLogThreadInit,
1090  JsonLogThreadDeinit, NULL);
1091  /* Enip JSON logger. */
1092  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonEnipLog", "eve-log.enip",
1093  OutputJsonLogInitSub, ALPROTO_ENIP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1094  JsonLogThreadDeinit, NULL);
1095  /* Ldap JSON logger. */
1096  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonLdapLog", "eve-log.ldap",
1097  OutputJsonLogInitSub, ALPROTO_LDAP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1098  JsonLogThreadDeinit, NULL);
1099  /* DoH2 JSON logger. */
1101  /* Template JSON logger. */
1102  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateLog", "eve-log.template",
1103  OutputJsonLogInitSub, ALPROTO_TEMPLATE, JsonGenericDirPacketLogger, JsonLogThreadInit,
1104  JsonLogThreadDeinit, NULL);
1105  /* RDP JSON logger. */
1106  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRdpLog", "eve-log.rdp",
1107  OutputJsonLogInitSub, ALPROTO_RDP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1108  JsonLogThreadDeinit, NULL);
1109  SCLogDebug("rdp json logger registered.");
1110  /* DCERPC JSON logger. */
1112  /* app layer frames */
1114  /* BitTorrent DHT JSON logger */
1115  if (ConfGetNode("app-layer.protocols.bittorrent-dht") != NULL) {
1116  /* Register as an eve sub-module. */
1117  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonBitTorrentDHTLog",
1118  "eve-log.bittorrent-dht", OutputJsonLogInitSub, ALPROTO_BITTORRENT_DHT,
1119  JsonGenericDirPacketLogger, JsonLogThreadInit, JsonLogThreadDeinit, NULL);
1120  }
1121  /* ARP JSON logger */
1123 }
1124 
1125 static EveJsonSimpleAppLayerLogger simple_json_applayer_loggers[ALPROTO_MAX] = {
1126  { ALPROTO_UNKNOWN, NULL },
1127  { ALPROTO_HTTP1, NULL }, // special: uses some options flags
1129  { ALPROTO_SMTP, NULL }, // special: uses state
1131  { ALPROTO_SSH, rs_ssh_log_json },
1132  { ALPROTO_IMAP, NULL }, // protocol detection only
1133  { ALPROTO_JABBER, NULL }, // no parser, no logging
1134  { ALPROTO_SMB, NULL }, // special: uses state
1135  { ALPROTO_DCERPC, NULL }, // special: uses state
1136  { ALPROTO_IRC, NULL }, // no parser, no logging
1138  { ALPROTO_MODBUS, (EveJsonSimpleTxLogFunc)rs_modbus_to_json },
1139  { ALPROTO_ENIP, SCEnipLoggerLog },
1141  { ALPROTO_NFS, NULL }, // special: uses state
1142  { ALPROTO_NTP, NULL }, // no logging
1144  { ALPROTO_TFTP, (EveJsonSimpleTxLogFunc)rs_tftp_log_json_request },
1145  { ALPROTO_IKE, NULL }, // special: uses state
1146  { ALPROTO_KRB5, (EveJsonSimpleTxLogFunc)rs_krb5_log_json_response },
1147  { ALPROTO_QUIC, rs_quic_to_json },
1148  { ALPROTO_DHCP, NULL }, // TODO missing
1149  { ALPROTO_SNMP, (EveJsonSimpleTxLogFunc)rs_snmp_log_json_response },
1150  { ALPROTO_SIP, (EveJsonSimpleTxLogFunc)rs_sip_log_json },
1151  { ALPROTO_RFB, rs_rfb_logger_log },
1154  { ALPROTO_TELNET, NULL }, // no logging
1155  { ALPROTO_WEBSOCKET, rs_websocket_logger_log },
1156  { ALPROTO_LDAP, rs_ldap_logger_log },
1158  { ALPROTO_TEMPLATE, rs_template_logger_log },
1159  { ALPROTO_RDP, (EveJsonSimpleTxLogFunc)rs_rdp_to_json },
1160  { ALPROTO_HTTP2, rs_http2_log_json },
1161  { ALPROTO_BITTORRENT_DHT, rs_bittorrent_dht_logger_log },
1162  { ALPROTO_POP3, NULL }, // protocol detection only
1163  { ALPROTO_HTTP, NULL }, // signature protocol, not for app-layer logging
1164  { ALPROTO_FAILED, NULL },
1165 #ifdef UNITTESTS
1166  { ALPROTO_TEST, NULL },
1167 #endif /* UNITESTS */
1168 };
1169 
1171 {
1172  if (alproto < ALPROTO_MAX) {
1173  BUG_ON(simple_json_applayer_loggers[alproto].proto != alproto);
1174  return &simple_json_applayer_loggers[alproto];
1175  }
1176  return NULL;
1177 }
RootLogger_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.c:89
log-stats.h
OutputModule_::parent_name
const char * parent_name
Definition: output.h:60
OutputFileRolloverFlag
OutputFileRolloverFlag
Definition: output.c:126
LogTlsStoreRegister
void LogTlsStoreRegister(void)
Definition: log-tlsstore.c:448
tm-threads.h
ALPROTO_TEST
@ ALPROTO_TEST
Definition: app-layer-protos.h:76
output-json-ftp.h
OutputJsonLogInitSub
OutputInitResult OutputJsonLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
Definition: output-json-common.c:73
OutputDropLoggerEnable
int OutputDropLoggerEnable(void)
Definition: output.c:687
LoggerThreadStoreNode
LoggerThreadStoreNode
Definition: output.c:110
OutputLogFunc
TmEcode(* OutputLogFunc)(ThreadVars *, Packet *, void *)
Definition: output.h:53
JsonDoh2LogRegister
void JsonDoh2LogRegister(void)
Definition: output-json-dns.c:678
ALPROTO_IKE
@ ALPROTO_IKE
Definition: app-layer-protos.h:49
OutputRegisterStatsSubModule
void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a stats data output sub-module.
Definition: output.c:622
app-layer-ssh.h
JsonDCERPCLogRegister
void JsonDCERPCLogRegister(void)
Definition: output-json-dcerpc.c:67
OutputTxLoggerRegister
void OutputTxLoggerRegister(void)
Definition: output-tx.c:667
ALPROTO_DCERPC
@ ALPROTO_DCERPC
Definition: app-layer-protos.h:38
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:41
OutputJsonThreadCtx_::ctx
OutputJsonCtx * ctx
Definition: output-json.h:90
AlertJsonDoh2
bool AlertJsonDoh2(void *txptr, JsonBuilder *js)
Definition: output-json-dns.c:257
ALPROTO_ENIP
@ ALPROTO_ENIP
Definition: app-layer-protos.h:43
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
JsonSMBLogRegister
void JsonSMBLogRegister(void)
Definition: output-json-smb.c:79
OutputLoggerExitPrintStats
void OutputLoggerExitPrintStats(ThreadVars *tv, void *thread_data)
Definition: output.c:823
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:33
output-json-mqtt.h
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
output-eve-stream.h
OutputFileLoggerRegister
void OutputFileLoggerRegister(void)
Definition: output-file.c:239
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
ALPROTO_MODBUS
@ ALPROTO_MODBUS
Definition: app-layer-protos.h:42
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:84
ALPROTO_QUIC
@ ALPROTO_QUIC
Definition: app-layer-protos.h:51
ALPROTO_POP3
@ ALPROTO_POP3
Definition: app-layer-protos.h:66
SCEveJsonSimpleGetLogger
EveJsonSimpleAppLayerLogger * SCEveJsonSimpleGetLogger(AppProto alproto)
Definition: output.c:1170
ConfGetNode
ConfNode * ConfGetNode(const char *name)
Get a ConfNode by name.
Definition: conf.c:181
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
ALPROTO_JABBER
@ ALPROTO_JABBER
Definition: app-layer-protos.h:36
OutputModule_::StreamingLogFunc
StreamingLogger StreamingLogFunc
Definition: output.h:75
Flow_
Flow data structure.
Definition: flow.h:360
LogTlsLogRegister
void LogTlsLogRegister(void)
Definition: log-tlslog.c:524
OutputModule_::FileLogFunc
FileLogger FileLogFunc
Definition: output.h:72
StreamingLogger
int(* StreamingLogger)(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
OutputModule_::logger_id
LoggerId logger_id
Definition: output.h:57
LoggerId
LoggerId
Definition: suricata-common.h:460
AppProtoToString
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
Definition: app-layer-protos.c:78
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:77
ALPROTO_IRC
@ ALPROTO_IRC
Definition: app-layer-protos.h:39
output-json-pgsql.h
JsonFileLogRegister
void JsonFileLogRegister(void)
Definition: output-json-file.c:352
output-json-frame.h
OutputModule_::ts_log_progress
int ts_log_progress
Definition: output.h:80
OutputJsonBuilderBuffer
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
Definition: output-json.c:967
output-json-netflow.h
JsonDNP3LogRegister
void JsonDNP3LogRegister(void)
Definition: output-json-dnp3.c:364
LogCustomFormatRegister
void LogCustomFormatRegister(void)
Definition: log-cf-common.c:271
EveJsonSimpleAppLayerLogger::proto
AppProto proto
Definition: output.h:195
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:660
output-json-tls.h
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:54
OutputSetupActiveLoggers
void OutputSetupActiveLoggers(void)
Definition: output.c:870
AlertSyslogRegister
void AlertSyslogRegister(void)
Function to register the AlertSyslog module.
Definition: alert-syslog.c:382
OutputModule_::StatsLogFunc
StatsLogger StatsLogFunc
Definition: output.h:76
ALPROTO_LDAP
@ ALPROTO_LDAP
Definition: app-layer-protos.h:60
OutputRegisterTxModule
void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a tx output module.
Definition: output.c:394
OutputRegisterFileSubModule
void OutputRegisterFileSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FileLogger FileLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a file output sub-module.
Definition: output.c:424
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)
Definition: output-tx.h:33
FlowLogger
int(* FlowLogger)(ThreadVars *, void *thread_data, Flow *f)
Definition: output-flow.h:32
ALPROTO_FTP
@ ALPROTO_FTP
Definition: app-layer-protos.h:31
PacketLogger
int(* PacketLogger)(ThreadVars *, void *thread_data, const Packet *)
Definition: output-packet.h:30
TAILQ_INSERT_TAIL
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:294
PcapLogRegister
void PcapLogRegister(void)
Definition: log-pcap.c:210
proto
uint8_t proto
Definition: decode-template.h:0
OutputModule_::InitSubFunc
OutputInitSubFunc InitSubFunc
Definition: output.h:62
OutputRegisterStreamingModule
void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a streaming data output module.
Definition: output.c:543
ALPROTO_SSH
@ ALPROTO_SSH
Definition: app-layer-protos.h:34
app-layer-ftp.h
ALPROTO_DHCP
@ ALPROTO_DHCP
Definition: app-layer-protos.h:52
OutputModule_::PacketLogFunc
PacketLogger PacketLogFunc
Definition: output.h:68
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:83
ALPROTO_MAX
@ ALPROTO_MAX
Definition: app-layer-protos.h:79
EveJsonSimpleTxLogFunc
bool(* EveJsonSimpleTxLogFunc)(void *, struct JsonBuilder *)
Definition: output.h:192
JsonStatsLogRegister
void JsonStatsLogRegister(void)
Definition: output-json-stats.c:501
LogTcpDataLogRegister
void LogTcpDataLogRegister(void)
Definition: log-tcp-data.c:46
OutputRegisterRootLoggers
void OutputRegisterRootLoggers(void)
Register all root loggers.
Definition: output.c:901
OutputLoggerThreadDeinit
TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data)
Definition: output.c:797
OutputModule_::alproto
AppProto alproto
Definition: output.h:77
JsonTlsLogRegister
void JsonTlsLogRegister(void)
Definition: output-json-tls.c:716
alert-syslog.h
JsonFlowLogRegister
void JsonFlowLogRegister(void)
Definition: output-json-flow.c:348
JsonPgsqlAddMetadata
bool JsonPgsqlAddMetadata(void *vtx, JsonBuilder *jb)
Definition: output-json-pgsql.c:62
TmModuleLoggerRegister
void TmModuleLoggerRegister(void)
Definition: output.c:892
JsonTlsLogJSONExtended
bool JsonTlsLogJSONExtended(void *vtx, JsonBuilder *tjs)
Definition: output-json-tls.c:489
output-json-dcerpc.h
EveFTPDataAddMetadata
bool EveFTPDataAddMetadata(void *vtx, JsonBuilder *jb)
Definition: app-layer-ftp.c:1444
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:82
OutputJsonRegister
void OutputJsonRegister(void)
Definition: output-json.c:83
OutputClearActiveLoggers
void OutputClearActiveLoggers(void)
Definition: output.c:883
ALPROTO_KRB5
@ ALPROTO_KRB5
Definition: app-layer-protos.h:50
OutputModule_::stream_type
enum OutputStreamingType stream_type
Definition: output.h:78
OutputJsonThreadCtx_
Definition: output-json.h:89
ALPROTO_SNMP
@ ALPROTO_SNMP
Definition: app-layer-protos.h:53
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:707
LogHttpLogRegister
void LogHttpLogRegister(void)
Definition: log-httplog.c:65
AlertJsonDnp3
bool AlertJsonDnp3(void *vtx, JsonBuilder *js)
Definition: output-json-dnp3.c:213
OutputModule_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.h:64
TAILQ_HEAD_INITIALIZER
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:236
output_modules
OutputModuleList output_modules
OutputInitSubFunc
OutputInitResult(* OutputInitSubFunc)(ConfNode *, OutputCtx *)
Definition: output.h:52
JsonAnomalyLogRegister
void JsonAnomalyLogRegister(void)
Definition: output-json-anomaly.c:451
TAILQ_REMOVE
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:312
OutputModule_::FiledataLogFunc
FiledataLogger FiledataLogFunc
Definition: output.h:73
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:453
util-error.h
FileLogger
int(* FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
Definition: output-file.h:48
log-tcp-data.h
FiledataLogger
int(* FiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
Definition: output-filedata.h:49
OutputModule_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.h:65
ALPROTO_DNP3
@ ALPROTO_DNP3
Definition: app-layer-protos.h:44
output-json.h
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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output.c:374
ALPROTO_SMTP
@ ALPROTO_SMTP
Definition: app-layer-protos.h:32
output-json-file.h
OutputRegisterModule
void OutputRegisterModule(const char *, const char *, OutputInitFunc)
CreateEveHeader
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Definition: output-json.c:816
JsonIKELogRegister
void JsonIKELogRegister(void)
Definition: output-json-ike.c:182
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:40
log-tlslog.h
EveFTPLogCommand
bool EveFTPLogCommand(void *vtx, JsonBuilder *jb)
Definition: output-json-ftp.c:49
OutputLoggerThreadInit
TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
Definition: output.c:766
app-layer-parser.h
JsonMQTTLogRegister
void JsonMQTTLogRegister(void)
Definition: output-json-mqtt.c:193
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:300
OutputFilestoreRegister
void OutputFilestoreRegister(void)
Definition: output-filestore.c:506
OutputRegisterLoggers
void OutputRegisterLoggers(void)
Register all non-root logging modules.
Definition: output.c:970
OutputModule_::conf_name
const char * conf_name
Definition: output.h:59
output-json-anomaly.h
OutputModule_::FlowLogFunc
FlowLogger FlowLogFunc
Definition: output.h:74
OutputDeregisterAll
void OutputDeregisterAll(void)
Deregister all modules. Useful for a memory clean exit.
Definition: output.c:675
Packet_
Definition: decode.h:479
RootLogger_::ActiveCntFunc
OutputGetActiveCountFunc ActiveCntFunc
Definition: output.c:91
OutputPacketLoggerRegister
void OutputPacketLoggerRegister(void)
Definition: output-packet.c:213
ALPROTO_IMAP
@ ALPROTO_IMAP
Definition: app-layer-protos.h:35
ALPROTO_RDP
@ ALPROTO_RDP
Definition: app-layer-protos.h:63
conf.h
OutputNotifyFileRotation
void OutputNotifyFileRotation(void)
Notifies all registered file rotation notification flags.
Definition: output.c:745
TAILQ_HEAD
typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_)
Definition: output.c:112
ALPROTO_TELNET
@ ALPROTO_TELNET
Definition: app-layer-protos.h:58
TmEcode
TmEcode
Definition: tm-threads-common.h:81
ALPROTO_DOH2
@ ALPROTO_DOH2
Definition: app-layer-protos.h:61
EveStreamLogRegister
void EveStreamLogRegister(void)
Definition: output-eve-stream.c:452
ALPROTO_TFTP
@ ALPROTO_TFTP
Definition: app-layer-protos.h:48
OutputModule_::ThreadExitPrintStats
ThreadExitPrintStatsFunc ThreadExitPrintStats
Definition: output.h:66
RootLogger_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.c:88
ALPROTO_HTTP2
@ ALPROTO_HTTP2
Definition: app-layer-protos.h:64
EveJsonSimpleAppLayerLogger
Definition: output.h:194
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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output.c:343
log-pcap.h
alert-fastlog.h
TxLoggerCondition
bool(* TxLoggerCondition)(ThreadVars *, const Packet *, void *state, void *tx, uint64_t tx_id)
Definition: output-tx.h:38
LogStatsLogRegister
void LogStatsLogRegister(void)
Definition: log-stats.c:285
JsonFrameLogRegister
void JsonFrameLogRegister(void)
Definition: output-json-frame.c:559
cnt
uint32_t cnt
Definition: tmqh-packetpool.h:7
OutputRegisterFiledataModule
void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a file data output module.
Definition: output.c:464
OutputModule_::TxLogCondition
TxLoggerCondition TxLogCondition
Definition: output.h:71
LOG_DIR_PACKET
@ LOG_DIR_PACKET
Definition: output-json.h:37
AlertJsonDns
bool AlertJsonDns(void *txptr, JsonBuilder *js)
Definition: output-json-dns.c:251
suricata-common.h
output-json-stats.h
OutputRegisterPacketSubModule
void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a packet output sub-module.
Definition: output.c:210
EveJsonSimpleAppLayerLogger::LogTx
EveJsonSimpleTxLogFunc LogTx
Definition: output.h:196
output-json-nfs.h
ALPROTO_HTTP1
@ ALPROTO_HTTP1
Definition: app-layer-protos.h:30
ThreadExitPrintStatsFunc
void(* ThreadExitPrintStatsFunc)(ThreadVars *, void *)
Definition: tm-modules.h:42
ALPROTO_PGSQL
@ ALPROTO_PGSQL
Definition: app-layer-protos.h:57
TAILQ_NEXT
#define TAILQ_NEXT(elm, field)
Definition: queue.h:307
RootLogger_::ThreadExitPrintStats
ThreadExitPrintStatsFunc ThreadExitPrintStats
Definition: output.c:90
ALPROTO_FTPDATA
@ ALPROTO_FTPDATA
Definition: app-layer-protos.h:47
output-filestore.h
FatalError
#define FatalError(...)
Definition: util-debug.h:502
LuaLogRegister
void LuaLogRegister(void)
Definition: output-lua.c:888
ALPROTO_WEBSOCKET
@ ALPROTO_WEBSOCKET
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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Definition: output.c:405
JsonSmtpLogRegister
void JsonSmtpLogRegister(void)
Definition: output-json-smtp.c:192
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
log-httplog.h
JsonMetadataLogRegister
void JsonMetadataLogRegister(void)
Definition: output-json-metadata.c:95
output-json-alert.h
PacketLogCondition
bool(* PacketLogCondition)(ThreadVars *, void *thread_data, const Packet *)
Definition: output-packet.h:35
OutputModule_::PacketConditionFunc
PacketLogCondition PacketConditionFunc
Definition: output.h:69
OutputRegisterPacketModule
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a packet output module.
Definition: output.c:170
RootLogger
struct RootLogger_ RootLogger
LOG_DIR_FLOW
@ LOG_DIR_FLOW
Definition: output-json.h:38
output-json-dns.h
OutputGetActiveCountFunc
uint32_t(* OutputGetActiveCountFunc)(void)
Definition: output.h:54
log-cf-common.h
output-json-metadata.h
LOGGER_JSON_TX
@ LOGGER_JSON_TX
Definition: suricata-common.h:468
OutputStreamingType
OutputStreamingType
Definition: output-streaming.h:35
OutputRegisterFlowSubModule
void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a flow output sub-module.
Definition: output.c:503
JsonDnsLogRegister
void JsonDnsLogRegister(void)
Definition: output-json-dns.c:671
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:261
OutputLoggerLog
TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
Definition: output.c:752
SCFree
#define SCFree(p)
Definition: util-mem.h:61
output-json-dhcp.h
JsonMQTTAddMetadata
bool JsonMQTTAddMetadata(void *vtx, JsonBuilder *js)
Definition: output-json-mqtt.c:63
JsonDropLogRegister
void JsonDropLogRegister(void)
Definition: output-json-drop.c:391
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:70
ALPROTO_MQTT
@ ALPROTO_MQTT
Definition: app-layer-protos.h:56
OutputModule_::tc_log_progress
int tc_log_progress
Definition: output.h:79
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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a tx output module with progress.
Definition: output.c:363
OutputInitFunc
OutputInitResult(* OutputInitFunc)(ConfNode *)
Definition: output.h:51
ALPROTO_HTTP
@ ALPROTO_HTTP
Definition: app-layer-protos.h:70
ALPROTO_UNKNOWN
@ ALPROTO_UNKNOWN
Definition: app-layer-protos.h:29
ALPROTO_FAILED
@ ALPROTO_FAILED
Definition: app-layer-protos.h:74
ALPROTO_TEMPLATE
@ ALPROTO_TEMPLATE
Definition: app-layer-protos.h:62
output-lua.h
OutputRegisterRootLogger
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
Definition: output.c:837
ALPROTO_RFB
@ ALPROTO_RFB
Definition: app-layer-protos.h:55
JsonHttpLogRegister
void JsonHttpLogRegister(void)
Definition: output-json-http.c:652
ALPROTO_BITTORRENT_DHT
@ ALPROTO_BITTORRENT_DHT
Definition: app-layer-protos.h:65
output-json-smb.h
ALPROTO_NTP
@ ALPROTO_NTP
Definition: app-layer-protos.h:46
ALPROTO_SMB
@ ALPROTO_SMB
Definition: app-layer-protos.h:37
JsonArpLogRegister
void JsonArpLogRegister(void)
Definition: output-json-arp.c:104
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:728
log-tlsstore.h
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:459
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
OutputFiledataLoggerRegister
void OutputFiledataLoggerRegister(void)
Definition: output-filedata.c:275
OutputRegisterStatsModule
void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a stats data output module.
Definition: output.c:584
OutputRegisterTxModuleWithCondition
void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
Register a tx output module with condition.
Definition: output.c:332
ALPROTO_NFS
@ ALPROTO_NFS
Definition: app-layer-protos.h:45
output.h
JsonAlertLogRegister
void JsonAlertLogRegister(void)
Definition: output-json-alert.c:1025
JsonNFSLogRegister
void JsonNFSLogRegister(void)
Definition: output-json-nfs.c:110
OutputDropLoggerDisable
void OutputDropLoggerDisable(void)
Definition: output.c:695
JsonNetFlowLogRegister
void JsonNetFlowLogRegister(void)
Definition: output-json-netflow.c:295
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:41
OutputModule_::InitFunc
OutputInitFunc InitFunc
Definition: output.h:61
RootLogger_
Definition: output.c:86
output-json-drop.h