Closed philrz closed 3 years ago
Verified in zq
commit fbf5fe4c
.
Using the repro fragment above, the CSV is now generated without panic.
$ zq -version
Version: v0.27.0-6-gfbf5fe4c
$ zq -f csv repro.tzng.gz
_path,ts,ts_delta,peer,gaps,acks,percent_lost,event_type,src_ip,src_port,dest_ip,dest_port,vlan,proto,app_proto,alert.severity,alert.signature,alert.category,alert.action,alert.signature_id,alert.gid,alert.rev,alert.metadata.signature_severity,alert.metadata.former_category,alert.metadata.attack_target,alert.metadata.deployment,alert.metadata.affected_product,alert.metadata.created_at,alert.metadata.performance_impact,alert.metadata.updated_at,alert.metadata.malware_family,alert.metadata.tag,flow_id,pcap_cnt,tx_id,icmp_code,icmp_type,community_id,mem,pkts_proc,bytes_recv,pkts_dropped,pkts_link,pkt_lag,events_proc,events_queued,active_tcp_conns,active_udp_conns,active_icmp_conns,tcp_conns,udp_conns,icmp_conns,timers,active_timers,files,active_files,dns_requests,active_dns_requests,reassem_tcp_size,reassem_file_size,reassem_frag_size,reassem_unknown_size
capture_loss,2018-03-23T20:00:14.3314Z,111.694792,zeek,15,72667,0.020642,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,2018-03-23T20:00:14.3314Z,,,,,,alert,13.107.4.50,80,10.47.8.154,51006,,TCP,http,3,SURICATA STREAM ESTABLISHED packet out of window,Generic Protocol Command Decode,allowed,2210020,1,2,,,,,,,,,,,1741344505971013,1650919,,,,1:kZkWyvbJTmfVpW38Axh1yk/fHKE=,,,,,,,,,,,,,,,,,,,,,,,,
stats,2018-03-23T20:00:14.3314Z,,zeek,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,534,1650918,473585160,,,,1060403,1060403,29135,87,1446,392651,1453,1447,1217499,0,4155,6,15,0,64425,0,0,0
The same is true for the original larger ZNG based on the pcap linked above (line count is +1 as expected due to the CSV header line).
$ zq -t 'count()' all.zng
#0:record[count:uint64]
0:[670822;]
$ zq -f csv all.zng > all.csv
$ wc -l all.csv
670823 all.csv
Thanks @mccanne!
Repro is with
zq
commitfcad36bc
and the attached test file repro.tzng.gz:I've also confirmed this is not a new bug. While the automatic
fuse
for CSV is new functionality, if I go back to the prior GA release ofzq
taggedv0.26.0
, I can trigger the same repro if I include an explicit call tofuse
.(The original repro was actually seen by importing test pcap https://archive.wrccdc.org/pcaps/2018/wrccdc.2018-03-23.010014000000000.pcap.gz into Brim with a
zqd
based on a recent commit, then trying to use the new CSV export option without entering an explicit query and hence requesting all the data be exported as very wide CSV. I'd not noticed this issue before because in the verification of the CSV export feature, I happened to have used an explicit Z query of_path=http or _path=ssl
first to isolate diverse records that would need the auto-fuse
treatment, but apparently that was not the right data to trigger this bug. I've since confirmed that just the diversity in those three lines above is all that it takes to trigger it, though.)