]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
suricata: don't display msg in list-keyword mode.
authorEric Leblond <eric@regit.org>
Tue, 6 Nov 2012 18:21:42 +0000 (19:21 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 19 Nov 2012 15:36:38 +0000 (16:36 +0100)
In list-keywords and list-app-layer mode, suricata now only
displays the messages linked with the feature. This allow users
to redirect the output and easily work on it. For exemple, the
csv output will be easily imported into a spreadsheet.

src/suricata.c

index f9114a914dfb3a8eb8e0a50049f7e98b91ab2e67..753d03d21579f6b46313d41d113181fcfa75de00 100644 (file)
@@ -1209,13 +1209,15 @@ int main(int argc, char **argv)
         }
     }
 
+    if (!list_keywords && !list_app_layer_protocols) {
 #ifdef REVISION
-    SCLogInfo("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(REVISION));
+        SCLogInfo("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(REVISION));
 #elif defined RELEASE
-    SCLogInfo("This is %s version %s RELEASE", PROG_NAME, PROG_VER);
+        SCLogInfo("This is %s version %s RELEASE", PROG_NAME, PROG_VER);
 #else
-    SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER);
+        SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER);
 #endif
+    }
 
 #ifndef HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW
     SCLogWarning(SC_WARN_OUTDATED_LIBHTP, "libhtp < 0.2.7 detected. Keyword "
@@ -1224,7 +1226,8 @@ int main(int argc, char **argv)
 
     SetBpfString(optind, argv);
 
-    UtilCpuPrintSummary();
+    if (!list_keywords && !list_app_layer_protocols)
+        UtilCpuPrintSummary();
 
 #ifdef __SC_CUDA_SUPPORT__
     /* Init the CUDA environment */
@@ -1388,7 +1391,8 @@ int main(int argc, char **argv)
 
     /* Load the Host-OS lookup. */
     SCHInfoLoadFromConfig();
-    DefragInit();
+    if (!list_keywords && !list_app_layer_protocols)
+        DefragInit();
 
     if (run_mode == RUNMODE_UNKNOWN) {
         if (!engine_analysis && !list_keywords && !conf_test) {