-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
analyzer: Have exited processes read all data
This commit changes the behavior for analyzer processes so that processes that have successfully exited without reading all the data will continue to consume data from the byte stream insteading of returning an error and putting a stop to the copy goroutine. Closes #331
- Loading branch information
Showing
2 changed files
with
60 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
script: | | ||
mkdir wd1; mv noread.sh wd1 | ||
mkdir wd2; mv readall.sh wd2 | ||
bash gen.sh | brimcap analyze -config=config.yaml - | zq -z 'count()' - | ||
inputs: | ||
- name: alerts.pcap | ||
- name: config.yaml | ||
data: | | ||
analyzers: | ||
- cmd: bash | ||
args: [noread.sh] | ||
name: noread | ||
globs: ["*.json"] # so ztail will not try to read all the other schtuff | ||
workdir: wd1 | ||
- cmd: bash | ||
args: [readall.sh] | ||
name: readall | ||
globs: ["*.zson"] | ||
workdir: wd2 | ||
- name: gen.sh | ||
data: | | ||
for i in {1..10000}; do | ||
echo "{x: $i}" | ||
done | ||
- name: noread.sh | ||
data: | | ||
exit 0 | ||
- name: readall.sh | ||
data: | | ||
cat /dev/stdin > readall.zson | ||
outputs: | ||
- name: stdout | ||
data: | | ||
10000(uint64) |