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

zqd: Multipart log ingest #1336

Merged
merged 7 commits into from
Nov 13, 2020
Merged

zqd: Multipart log ingest #1336

merged 7 commits into from
Nov 13, 2020

Conversation

mattnibs
Copy link
Collaborator

Rearrange zqd log post endpoint so log files are transmitted over
the network instead of opened from a locally available file.

The files are submitted as an http multipart request. JSON typing
can be submitted as part of the request- it should be given the
form value of "json_type_config".

For http 1.1 the server cannot send responses back while the
requester is sending data. As a result remove status updates and
transmit any wires in the server responses. Clients that want to
know the amount of data sent while the request is in flight will
have to keep track the bytes written over the wire themselves.

Closes #1084

@mattnibs
Copy link
Collaborator Author

note: This will break brim master. I am working on an update there.

@mattnibs mattnibs requested a review from a team September 21, 2020 17:02
zqd/ingest/logreader.go Outdated Show resolved Hide resolved
zqd/ingest/logreader.go Outdated Show resolved Hide resolved
@henridf
Copy link
Contributor

henridf commented Sep 22, 2020

General question... with this API it's now possible to post one or more files with curl -F? 😎

Copy link
Contributor

@henridf henridf left a comment

Choose a reason for hiding this comment

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

lgtm

@mattnibs
Copy link
Collaborator Author

General question... with this API it's now possible to post one or more files with curl -F? 😎

Yep! Good thinking from @alfred-landrum 😎

@mattnibs
Copy link
Collaborator Author

Will hold off on merging until we have accompanying changes on brim.

cmd/zapi/cmd/post/post.go Outdated Show resolved Hide resolved
zqd/api/logwriter.go Outdated Show resolved Hide resolved
zqd/api/logwriter.go Outdated Show resolved Hide resolved
zqd/api/logwriter.go Outdated Show resolved Hide resolved
zqd/handlers.go Outdated Show resolved Hide resolved
zqd/ingest/logreader.go Outdated Show resolved Hide resolved
@mattnibs
Copy link
Collaborator Author

mattnibs commented Nov 4, 2020

@brimsec/zq this is ready for another review. Now that both multipart and the former post path methods exist, this can go in without any brim dependent changes.

ztest/shell.go Outdated Show resolved Hide resolved
@mattnibs mattnibs force-pushed the log-post-streaming branch 2 times, most recently from 98bc1fb to b0b92b3 Compare November 5, 2020 21:02
Copy link
Member

@nwt nwt left a comment

Choose a reason for hiding this comment

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

Delete the empty files named file and file2.

api/api.go Outdated Show resolved Hide resolved
api/client/connection.go Outdated Show resolved Hide resolved
@mattnibs mattnibs force-pushed the log-post-streaming branch 2 times, most recently from 0b59639 to f0e1a47 Compare November 6, 2020 17:56
Allow ingest of log data through streaming multi-part http request.

The files are submitted as an http multipart request. JSON typing
can be submitted as part of the request- it should be given the
form value of "json_type_config".

For http 1.1 the server cannot send responses back while the
requester is sending data. As a result remove status updates and
transmit any wires in the server responses. Clients that want to
know the amount of data sent while the request is in flight will
have to keep track the bytes written over the wire themselves.

The zapi post commands have been reformatted. They are as such:

- postpcap - post a pcap file to a space
- postpath - post paths that will be opened and read by zqd.
- post - stream log data to zqd over the network.

Closes #1084
api/client/multipartwriter.go Outdated Show resolved Hide resolved
api/client/multipartwriter.go Outdated Show resolved Hide resolved
api/client/multipartwriter.go Outdated Show resolved Hide resolved
cmd/zapi/cmd/new/new.go Outdated Show resolved Hide resolved
cmd/zapi/cmd/post/flags.go Outdated Show resolved Hide resolved
ppl/zqd/ingest/multipartreader.go Outdated Show resolved Hide resolved
cmd/zapi/cmd/post/path.go Outdated Show resolved Hide resolved
mattnibs and others added 3 commits November 6, 2020 13:09
Co-authored-by: Noah Treuhaft <noah.treuhaft@gmail.com>
Co-authored-by: Noah Treuhaft <noah.treuhaft@gmail.com>
Co-authored-by: Noah Treuhaft <noah.treuhaft@gmail.com>
cmd/zapi/cmd/post/pcap.go Outdated Show resolved Hide resolved
"#0:record[_path:string,ts:time,uid:bstring]",
"0:[conn;2;CBrzd94qfowOqJwCHa;]",
}
const src1 = `#0:record[_path:string,ts:time,uid:bstring]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: align these first lines on the left side of the file

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.

Crash when "zapi post -f" is used and the Space already exists Support network based multiple log import
5 participants