]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
file-json: add file_id to message
authorEric Leblond <eric@regit.org>
Wed, 27 May 2015 12:01:36 +0000 (14:01 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 21 Jul 2015 21:40:42 +0000 (23:40 +0200)
This will allow to get the filename and by consequence the file
after a parsing of the EVEV log file.

src/output-json-file.c

index 5464088f1650be32a800153adee9c271dff7e169..cbfa0c4d0b6c598b26c4a44006f7c38a3d7fbe61 100644 (file)
@@ -242,6 +242,9 @@ static void FileWriteJsonRecord(JsonFileLogThread *aft, const Packet *p, const F
     }
     json_object_set_new(fjs, "stored",
                         (ff->flags & FILE_STORED) ? json_true() : json_false());
+    if (ff->flags & FILE_STORED) {
+        json_object_set_new(fjs, "file_id", json_integer(ff->file_id));
+    }
     json_object_set_new(fjs, "size", json_integer(ff->size));
     json_object_set_new(fjs, "tx_id", json_integer(ff->txid));