Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Zeek Logs #594

Merged
merged 15 commits into from
Apr 18, 2020
Merged

Post Zeek Logs #594

merged 15 commits into from
Apr 18, 2020

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented Apr 10, 2020

fixes #574

In this PR, we can use the "Open File" picker to ingest one or more zeek tsv files.

Notes:

  1. You are able to select multiple "files" even across different directories, but you are not able to select "directories" themselves. This is because on windows, a dialog picker must be either a "files" or "directory picker" according to the Electron Docs.

  2. I have added the ability to upload ndjson logs as well. It sends the default json_types_config, but it appears not to be fully working. I will work with Henri to debug the issue, and fix in a following PR.

  3. This only adds the functionality. There is another ticket to update the design of the file picker to make it clear you can upload zeek logs.

Tech details:

I've refactored the logic in the flows/openPacket.js file. I used a "Transaction" data structure which takes an array of "step" objects that look like {do: Function, undo: Function}. All the steps must succeed or else they get rolled back. The transaction calls the "do" function in each step. If a step throws an error, the "undo" function on all previous steps is called.

The return value of each "do" function becomes the args of the next "do" function, unless the return value is undefined. In that case, the previous args are passed through.

I think it reads much better now.

@jameskerr jameskerr force-pushed the post-zeek-logs branch 4 times, most recently from 9ecd933 to 9be265a Compare April 13, 2020 18:48
@jameskerr jameskerr requested review from mason-fish and a team April 13, 2020 19:20
@jameskerr jameskerr mentioned this pull request Apr 16, 2020
Copy link
Contributor

@mason-fish mason-fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks good as far as I can tell. Glad you included tests :) The new transaction looks pretty slick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingest Zeek Logs into Brim
2 participants