Skip to content

Commit 2ac23b8

Browse files
committed
Improve netflow writer logging
1 parent 1c8bf7f commit 2ac23b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netflowwriter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ def process_named_pipe(named_pipe_filename):
4040
log.info("Named pipe closed")
4141
break
4242

43-
log.info(f"Received record: {len(line)} bytes")
4443
write_record(json.loads(line))
4544

4645

4746
def write_record(j):
4847
with db.cursor() as c:
4948
# first save the flow record:
5049
ts = datetime.utcfromtimestamp(j["ts"])
50+
log.info(f"Received record: {ts} from {j['client'][0]}")
5151
c.execute(f"INSERT INTO {DB_PREFIX}records (ts, client_ip, version) VALUES (%s, %s, %s) RETURNING seq;", (ts, j['client'][0], j['version'],))
5252
record_seq = c.fetchone()[0]
5353

0 commit comments

Comments
 (0)