Skip to content

Commit

Permalink
Fixed up some minor issues with JSON stdout output.
Browse files Browse the repository at this point in the history
  • Loading branch information
keithjjones committed May 13, 2022
1 parent 1387d29 commit e6547dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v0.3.8 Fixed up some minor issues with JSON stdout output.
v0.3.7 Added Docker pieces.
v0.3.6 Fixed a bug with the slash on the end of the ES url option.
v0.3.5 Removed need for trailing slash on ES URL.
Expand Down
6 changes: 3 additions & 3 deletions zeek2es.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def sendbulk(args, outstring, es_index, filename):
if not args['supresswarnings']:
print("WARNING! PUT did not return OK! Your index {} is incomplete. Filename: {} Response: {} {}".format(es_index, filename, res, res.text))
else:
print(outstring)
print(outstring.strip())

# A function to send the datastream info to ES.
def senddatastream(args, es_index, mappings):
Expand Down Expand Up @@ -436,7 +436,7 @@ def main(**args):
putpipeline = True

# Once we get more than "lines", we send it to ES
if n >= args['lines']:
if n >= args['lines'] or (args['stdout'] and len(output) > 0):
sendbulk(args, outstring, es_index, filename)
outstring = ""
n = 0
Expand Down Expand Up @@ -572,7 +572,7 @@ def main(**args):
n += 1

# Here we output a set of lines to the ES server.
if n >= args['lines']:
if n >= args['lines'] or (args['stdout'] and len(outstring) > 0):
sendbulk(args, outstring, es_index, filename)
outstring = ""
n = 0
Expand Down

0 comments on commit e6547dd

Please sign in to comment.