forked from idaholab/Malcolm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
having temporarily backported the patch from arkime/arkime#1877 into …
…my build to specify event.dataset to arkime's capture
- Loading branch information
Showing
9 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ | |
], | ||
"visibleHeaders": [ | ||
"protocol", | ||
"event.provider", | ||
"event.dataset", | ||
"firstPacket", | ||
"lastPacket", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/capture/db.c b/capture/db.c | ||
index 2515b177..0a6d06bd 100644 | ||
--- a/capture/db.c | ||
+++ b/capture/db.c | ||
@@ -71,6 +71,7 @@ LOCAL int dbExit; | ||
LOCAL char *esBulkQuery; | ||
LOCAL int esBulkQueryLen; | ||
LOCAL char *ecsEventProvider; | ||
+LOCAL char *ecsEventDataset; | ||
|
||
extern uint64_t packetStats[MOLOCH_PACKET_MAX]; | ||
|
||
@@ -906,8 +907,12 @@ void moloch_db_save_session(MolochSession_t *session, int final) | ||
} | ||
BSB_EXPORT_cstr(jbsb, "],"); | ||
|
||
- if (ecsEventProvider) { | ||
+ if (ecsEventProvider && ecsEventDataset) { | ||
+ BSB_EXPORT_sprintf(jbsb, "\"event\":{\"provider\":\"%s\", \"dataset\":\"%s\"},", ecsEventProvider, ecsEventDataset); | ||
+ } else if (ecsEventProvider) { | ||
BSB_EXPORT_sprintf(jbsb, "\"event\":{\"provider\":\"%s\"},", ecsEventProvider); | ||
+ } else if (ecsEventDataset) { | ||
+ BSB_EXPORT_sprintf(jbsb, "\"event\":{\"dataset\":\"%s\"},", ecsEventDataset); | ||
} | ||
|
||
int inGroupNum = 0; | ||
@@ -2661,6 +2666,7 @@ void moloch_db_init() | ||
} | ||
|
||
ecsEventProvider = moloch_config_str(NULL, "ecsEventProvider", NULL); | ||
+ ecsEventDataset = moloch_config_str(NULL, "ecsEventDataset", NULL); | ||
|
||
int thread; | ||
for (thread = 0; thread < config.packetThreads; thread++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters