flow.record 3.22.dev7__tar.gz → 3.22.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/PKG-INFO +1 -1
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/tools/rdump.py +9 -5
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/version.py +3 -3
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/PKG-INFO +1 -1
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/tools/test_rdump.py +37 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/.git-blame-ignore-revs +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/.gitattributes +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/COPYRIGHT +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/LICENSE +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/MANIFEST.in +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/README.md +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/filesystem.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/passivedns.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/records.json +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/selectors.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/examples/tcpconn.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/archive.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/avro.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/broker.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/csvfile.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/duckdb.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/elastic.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/jsonfile.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/line.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/mongo.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/split.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/splunk.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/sqlite.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/stream.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/text.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/adapter/xlsx.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/base.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/context.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/exceptions.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/credential.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/net/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/net/ip.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/net/ipv4.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/net/tcp.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/fieldtypes/net/udp.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/jsonpacker.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/packer.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/selector.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/stream.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/tools/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/tools/geoip.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/utils.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow/record/whitelist.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/SOURCES.txt +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/dependency_links.txt +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/entry_points.txt +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/requires.txt +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/flow.record.egg-info/top_level.txt +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/pyproject.toml +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/setup.cfg +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/_data/.gitkeep +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/_docs/Makefile +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/_docs/conf.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/_docs/index.rst +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/_utils.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_avro.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_csv.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_elastic.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_json.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_line.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_splunk.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_sqlite_duckdb.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_text.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/adapter/test_xlsx.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/conftest.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/fieldtypes/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/fieldtypes/test_boolean.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/fieldtypes/test_fieldtypes.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/fieldtypes/test_ip.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/packer/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/packer/test_json_packer.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/packer/test_packer.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/test_adapter.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/test_context.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/test_descriptor.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/test_multi_timestamp.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/record/test_record.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/selector/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/selector/test_compiled.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/selector/test_selectors.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/test_deprecations.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/test_regressions.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/test_utils.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tests/tools/__init__.py +0 -0
- {flow_record-3.22.dev7 → flow_record-3.22.dev8}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.22.
|
|
3
|
+
Version: 3.22.dev8
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -321,8 +321,14 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
321
321
|
root_logger.handlers.clear()
|
|
322
322
|
root_logger.addHandler(handler)
|
|
323
323
|
|
|
324
|
-
fields_to_exclude = args.exclude.split(",") if args.exclude else []
|
|
325
|
-
fields = args.fields.split(",") if args.fields else []
|
|
324
|
+
fields_to_exclude = list(filter(None, map(str.strip, args.exclude.split(",")))) if args.exclude else []
|
|
325
|
+
fields = list(filter(None, map(str.strip, args.fields.split(",")))) if args.fields else []
|
|
326
|
+
|
|
327
|
+
writer_options = {}
|
|
328
|
+
if fields:
|
|
329
|
+
writer_options["fields"] = fields
|
|
330
|
+
if fields_to_exclude:
|
|
331
|
+
writer_options["exclude"] = fields_to_exclude
|
|
326
332
|
|
|
327
333
|
if args.list_adapters:
|
|
328
334
|
list_adapters()
|
|
@@ -340,8 +346,6 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
340
346
|
}
|
|
341
347
|
uri = mode_to_uri.get(args.mode, uri)
|
|
342
348
|
qparams = {
|
|
343
|
-
"fields": args.fields,
|
|
344
|
-
"exclude": args.exclude,
|
|
345
349
|
"format_spec": args.format,
|
|
346
350
|
}
|
|
347
351
|
query = urlencode({k: v for k, v in qparams.items() if v})
|
|
@@ -393,7 +397,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
393
397
|
ret = 0
|
|
394
398
|
|
|
395
399
|
try:
|
|
396
|
-
with RecordWriter(uri) as record_writer:
|
|
400
|
+
with RecordWriter(uri, **writer_options) as record_writer:
|
|
397
401
|
for count, rec in enumerate(record_iterator, start=1): # noqa: B007
|
|
398
402
|
if args.record_source is not None:
|
|
399
403
|
rec._source = args.record_source
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '3.22.
|
|
32
|
-
__version_tuple__ = version_tuple = (3, 22, '
|
|
31
|
+
__version__ = version = '3.22.dev8'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 22, 'dev8')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g1ab6b5481'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.22.
|
|
3
|
+
Version: 3.22.dev8
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -904,3 +904,40 @@ def test_rdump_print_error_notes(
|
|
|
904
904
|
rdump.main([str(path), "-vvv"])
|
|
905
905
|
|
|
906
906
|
capsys.readouterr()
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
def test_rdump_fields_with_spaces(tmp_path: Path, capsysbinary: pytest.CaptureFixture) -> None:
|
|
910
|
+
"""Test if rdump handles spaces in field names gracefully."""
|
|
911
|
+
TestRecord = RecordDescriptor(
|
|
912
|
+
"test/record",
|
|
913
|
+
[
|
|
914
|
+
("varint", "count"),
|
|
915
|
+
("string", "foo"),
|
|
916
|
+
("string", "bar"),
|
|
917
|
+
],
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
path = tmp_path / "test.records"
|
|
921
|
+
out_path = tmp_path / "out.records"
|
|
922
|
+
with RecordWriter(path) as writer:
|
|
923
|
+
writer.write(TestRecord(count=0, foo="bar", bar="baz"))
|
|
924
|
+
|
|
925
|
+
# test if fields works with spaces in the name
|
|
926
|
+
rdump.main([str(path), "--fields", "foo, count ", "-w", str(out_path)])
|
|
927
|
+
with RecordReader(out_path) as reader:
|
|
928
|
+
records = list(reader)
|
|
929
|
+
assert len(records) == 1
|
|
930
|
+
assert list(records[0]._desc.fields.keys()) == ["foo", "count"]
|
|
931
|
+
|
|
932
|
+
# test if exclude works with spaces in the field names
|
|
933
|
+
rdump.main([str(path), "--exclude", " foo, bar ", "-w", str(out_path)])
|
|
934
|
+
with RecordReader(out_path) as reader:
|
|
935
|
+
records = list(reader)
|
|
936
|
+
assert len(records) == 1
|
|
937
|
+
assert list(records[0]._desc.fields.keys()) == ["count"]
|
|
938
|
+
|
|
939
|
+
# also test an adapter
|
|
940
|
+
rdump.main([str(path), "--exclude", " foo, bar ", "--csv"])
|
|
941
|
+
captured = capsysbinary.readouterr()
|
|
942
|
+
assert captured.err == b""
|
|
943
|
+
assert b"count,_source,_classification,_generated,_version\r\n" in captured.out
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|