Skip to content

Commit b4913fa

Browse files
committed
Added an additional check.
1 parent b2c5ffc commit b4913fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zeek2es.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def main(**args):
442442
n = 0
443443

444444
# We do this one last time to get rid of any remaining lines.
445-
if n != 0:
445+
if n != 0 and len(outstring) > 0:
446446
sendbulk(args, outstring, es_index, filename)
447447
else:
448448
# This does everything the TSV version does, but for JSON
@@ -578,7 +578,7 @@ def main(**args):
578578
n = 0
579579

580580
# We send the last of the data to the ES server, if there is any left.
581-
if n != 0:
581+
if n != 0 and len(outstring) > 0:
582582
sendbulk(args, outstring, es_index, filename)
583583

584584
# This deals with running as a script vs. cython.

0 commit comments

Comments
 (0)