diff --git a/src/logging/writers/DataSeries.cc b/src/logging/writers/DataSeries.cc index a7908a8e04..9f19028be3 100644 --- a/src/logging/writers/DataSeries.cc +++ b/src/logging/writers/DataSeries.cc @@ -61,7 +61,7 @@ std::string DataSeries::LogValueToString(threading::Value *val) if ( ds_use_integer_for_time ) { std::ostringstream ostr; - ostr << (unsigned long)(DataSeries::TIME_SCALE * val->val.double_val); + ostr << (uint64_t)(DataSeries::TIME_SCALE * val->val.double_val); return ostr.str(); } else diff --git a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.rotate/out b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.rotate/out index ed2aff0164..1e5e1b05c6 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.rotate/out +++ b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.rotate/out @@ -32,19 +32,10 @@ test.2011-03-07-12-00-05.ds test 11-03-07_12.00.05 11-03-07_12.59.55 1 dataserie -extent offset ExtentType -40 DataSeries: XmlType -392 test -508 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299466805.000000 10.0.0.1 20 10.0.0.2 1024 1299470395.000000 10.0.0.2 20 10.0.0.3 0 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -508 DataSeries: ExtentIndex > test.2011-03-07-04-00-05.ds # Extent Types ... @@ -69,19 +60,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299470405.000000 10.0.0.1 20 10.0.0.2 1025 1299473995.000000 10.0.0.2 20 10.0.0.3 1 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-05-00-05.ds # Extent Types ... @@ -106,19 +88,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299474005.000000 10.0.0.1 20 10.0.0.2 1026 1299477595.000000 10.0.0.2 20 10.0.0.3 2 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-06-00-05.ds # Extent Types ... @@ -143,19 +116,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299477605.000000 10.0.0.1 20 10.0.0.2 1027 1299481195.000000 10.0.0.2 20 10.0.0.3 3 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-07-00-05.ds # Extent Types ... @@ -180,19 +144,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -512 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299481205.000000 10.0.0.1 20 10.0.0.2 1028 1299484795.000000 10.0.0.2 20 10.0.0.3 4 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -512 DataSeries: ExtentIndex > test.2011-03-07-08-00-05.ds # Extent Types ... @@ -217,19 +172,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299484805.000000 10.0.0.1 20 10.0.0.2 1029 1299488395.000000 10.0.0.2 20 10.0.0.3 5 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-09-00-05.ds # Extent Types ... @@ -254,19 +200,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299488405.000000 10.0.0.1 20 10.0.0.2 1030 1299491995.000000 10.0.0.2 20 10.0.0.3 6 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-10-00-05.ds # Extent Types ... @@ -291,19 +228,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299492005.000000 10.0.0.1 20 10.0.0.2 1031 1299495595.000000 10.0.0.2 20 10.0.0.3 7 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-11-00-05.ds # Extent Types ... @@ -328,19 +256,10 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299495605.000000 10.0.0.1 20 10.0.0.2 1032 1299499195.000000 10.0.0.2 20 10.0.0.3 8 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex > test.2011-03-07-12-00-05.ds # Extent Types ... @@ -365,16 +284,7 @@ offset extenttype -extent offset ExtentType -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex # Extent, type='test' t id.orig_h id.orig_p id.resp_h id.resp_p 1299499205.000000 10.0.0.1 20 10.0.0.2 1033 1299502795.000000 10.0.0.2 20 10.0.0.3 9 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -392 test -516 DataSeries: ExtentIndex diff --git a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.test-logging/ssh.ds.txt b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.test-logging/ssh.ds.txt index 245bdcd9be..e9640dfd9d 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.test-logging/ssh.ds.txt +++ b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.test-logging/ssh.ds.txt @@ -25,19 +25,10 @@ -extent offset ExtentType -40 DataSeries: XmlType -436 ssh -644 DataSeries: ExtentIndex # Extent, type='ssh' t id.orig_h id.orig_p id.resp_h id.resp_p status country -1337058239.030366 1.2.3.4 1234 2.3.4.5 80 success unknown -1337058239.030366 1.2.3.4 1234 2.3.4.5 80 failure US -1337058239.030366 1.2.3.4 1234 2.3.4.5 80 failure UK -1337058239.030366 1.2.3.4 1234 2.3.4.5 80 success BR -1337058239.030366 1.2.3.4 1234 2.3.4.5 80 failure MX -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -436 ssh -644 DataSeries: ExtentIndex +1337216256.956476 1.2.3.4 1234 2.3.4.5 80 success unknown +1337216256.956476 1.2.3.4 1234 2.3.4.5 80 failure US +1337216256.956476 1.2.3.4 1234 2.3.4.5 80 failure UK +1337216256.956476 1.2.3.4 1234 2.3.4.5 80 success BR +1337216256.956476 1.2.3.4 1234 2.3.4.5 80 failure MX diff --git a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.time-as-int/conn.ds.txt b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.time-as-int/conn.ds.txt index 65d4ba0a67..1d7cba3b3c 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.time-as-int/conn.ds.txt +++ b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.time-as-int/conn.ds.txt @@ -49,10 +49,6 @@ -extent offset ExtentType -40 DataSeries: XmlType -672 conn -2948 DataSeries: ExtentIndex # Extent, type='conn' ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes 1300475167096535 UWkUyAuUGXf 141.142.220.202 5353 224.0.0.251 5353 udp dns 0 0 0 S0 F 0 D 1 73 0 0 @@ -89,8 +85,3 @@ ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes 1300475169780331 2cx26uAvUPl 141.142.220.235 6705 173.192.163.128 80 tcp 0 0 0 OTH F 0 h 0 0 1 48 1300475168724007 j4u32Pc5bif 141.142.220.118 48649 208.80.152.118 80 tcp 119904 525 232 S1 F 525 ShACad 3 164 3 396 1300475168855330 c4Zw9TmAE05 141.142.220.118 49997 208.80.152.3 80 tcp 219720 1125 734 S1 F 1125 ShACad 4 216 4 950 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -672 conn -2948 DataSeries: ExtentIndex diff --git a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/conn.ds.txt b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/conn.ds.txt index 104831f027..3cafa078de 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/conn.ds.txt +++ b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/conn.ds.txt @@ -49,10 +49,6 @@ -extent offset ExtentType -40 DataSeries: XmlType -700 conn -2860 DataSeries: ExtentIndex # Extent, type='conn' ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes 1300475167.096535 UWkUyAuUGXf 141.142.220.202 5353 224.0.0.251 5353 udp dns 0.000000 0 0 S0 F 0 D 1 73 0 0 @@ -89,8 +85,3 @@ ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes 1300475169.780331 2cx26uAvUPl 141.142.220.235 6705 173.192.163.128 80 tcp 0.000000 0 0 OTH F 0 h 0 0 1 48 1300475168.724007 j4u32Pc5bif 141.142.220.118 48649 208.80.152.118 80 tcp 0.119905 525 232 S1 F 525 ShACad 3 164 3 396 1300475168.855330 c4Zw9TmAE05 141.142.220.118 49997 208.80.152.3 80 tcp 0.219720 1125 734 S1 F 1125 ShACad 4 216 4 950 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -700 conn -2860 DataSeries: ExtentIndex diff --git a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/http.ds.txt b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/http.ds.txt index 0f1eebd251..adb7bb3f7b 100644 --- a/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/http.ds.txt +++ b/testing/btest/Baseline/scripts.base.frameworks.logging.dataseries.wikipedia/http.ds.txt @@ -63,10 +63,6 @@ -extent offset ExtentType -40 DataSeries: XmlType -804 http -1252 DataSeries: ExtentIndex # Extent, type='http' ts uid id.orig_h id.orig_p id.resp_h id.resp_p trans_depth method host uri referrer user_agent request_body_len response_body_len status_code status_msg info_code info_msg filename tags username password proxied mime_type md5 extraction_file 1300475168.843894 j4u32Pc5bif 141.142.220.118 48649 208.80.152.118 80 0 0 0 304 Not Modified 0 @@ -83,8 +79,3 @@ ts uid id.orig_h id.orig_p id.resp_h id.resp_p trans_depth method host uri refer 1300475169.074793 0Q4FH8sESw5 141.142.220.118 50000 208.80.152.3 80 0 0 0 304 Not Modified 0 1300475169.074938 slFea8xwSmb 141.142.220.118 49999 208.80.152.3 80 0 0 0 304 Not Modified 0 1300475169.075065 UfGkYA2HI2g 141.142.220.118 50001 208.80.152.3 80 0 0 0 304 Not Modified 0 -# Extent, type='DataSeries: ExtentIndex' -offset extenttype -40 DataSeries: XmlType -804 http -1252 DataSeries: ExtentIndex diff --git a/testing/btest/core/leaks/dataseries-rotate.bro b/testing/btest/core/leaks/dataseries-rotate.bro index 188de9717b..1afc517d1a 100644 --- a/testing/btest/core/leaks/dataseries-rotate.bro +++ b/testing/btest/core/leaks/dataseries-rotate.bro @@ -3,6 +3,7 @@ # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # # @TEST-GROUP: leaks +# @TEST-GROUP: dataseries # # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local bro -m -b -r %DIR/../rotation.trace %INPUT Log::default_writer=Log::WRITER_DATASERIES diff --git a/testing/btest/core/leaks/dataseries.bro b/testing/btest/core/leaks/dataseries.bro index 886ee54dd9..01dc3ffd79 100644 --- a/testing/btest/core/leaks/dataseries.bro +++ b/testing/btest/core/leaks/dataseries.bro @@ -4,6 +4,7 @@ # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # # @TEST-GROUP: leaks +# @TEST-GROUP: dataseries # # @TEST-REQUIRES: bro --help 2>&1 | grep -q mem-leaks # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local bro -m -r $TRACES/wikipedia.trace Log::default_writer=Log::WRITER_DATASERIES diff --git a/testing/btest/scripts/base/frameworks/logging/dataseries/rotate.bro b/testing/btest/scripts/base/frameworks/logging/dataseries/rotate.bro index 6a0cee5888..652a4596fb 100644 --- a/testing/btest/scripts/base/frameworks/logging/dataseries/rotate.bro +++ b/testing/btest/scripts/base/frameworks/logging/dataseries/rotate.bro @@ -3,7 +3,7 @@ # @TEST-GROUP: dataseries # # @TEST-EXEC: bro -b -r %DIR/../rotation.trace %INPUT 2>&1 Log::default_writer=Log::WRITER_DATASERIES | grep "test" >out -# @TEST-EXEC: for i in test.*.ds; do printf '> %s\n' $i; ds2txt $i; done >>out +# @TEST-EXEC: for i in test.*.ds; do printf '> %s\n' $i; ds2txt --skip-index $i; done >>out # @TEST-EXEC: btest-diff out module Test; diff --git a/testing/btest/scripts/base/frameworks/logging/dataseries/test-logging.bro b/testing/btest/scripts/base/frameworks/logging/dataseries/test-logging.bro index 0c5c52460b..ee0426ae55 100644 --- a/testing/btest/scripts/base/frameworks/logging/dataseries/test-logging.bro +++ b/testing/btest/scripts/base/frameworks/logging/dataseries/test-logging.bro @@ -3,7 +3,7 @@ # @TEST-GROUP: dataseries # # @TEST-EXEC: bro -b %INPUT Log::default_writer=Log::WRITER_DATASERIES -# @TEST-EXEC: ds2txt ssh.ds >ssh.ds.txt +# @TEST-EXEC: ds2txt --skip-index ssh.ds >ssh.ds.txt # @TEST-EXEC: btest-diff ssh.ds.txt module SSH; diff --git a/testing/btest/scripts/base/frameworks/logging/dataseries/time-as-int.bro b/testing/btest/scripts/base/frameworks/logging/dataseries/time-as-int.bro index e4dd6a5431..5e3f864b33 100644 --- a/testing/btest/scripts/base/frameworks/logging/dataseries/time-as-int.bro +++ b/testing/btest/scripts/base/frameworks/logging/dataseries/time-as-int.bro @@ -3,7 +3,7 @@ # @TEST-GROUP: dataseries # # @TEST-EXEC: bro -r $TRACES/wikipedia.trace %INPUT Log::default_writer=Log::WRITER_DATASERIES -# @TEST-EXEC: ds2txt conn.ds >conn.ds.txt +# @TEST-EXEC: ds2txt --skip-index conn.ds >conn.ds.txt # @TEST-EXEC: btest-diff conn.ds.txt redef LogDataSeries::use_integer_for_time = T; diff --git a/testing/btest/scripts/base/frameworks/logging/dataseries/wikipedia.bro b/testing/btest/scripts/base/frameworks/logging/dataseries/wikipedia.bro index 38726a8b10..ee1342c470 100644 --- a/testing/btest/scripts/base/frameworks/logging/dataseries/wikipedia.bro +++ b/testing/btest/scripts/base/frameworks/logging/dataseries/wikipedia.bro @@ -3,7 +3,7 @@ # @TEST-GROUP: dataseries # # @TEST-EXEC: bro -r $TRACES/wikipedia.trace Log::default_writer=Log::WRITER_DATASERIES -# @TEST-EXEC: ds2txt conn.ds >conn.ds.txt -# @TEST-EXEC: ds2txt http.ds >http.ds.txt +# @TEST-EXEC: ds2txt --skip-index conn.ds >conn.ds.txt +# @TEST-EXEC: ds2txt --skip-index http.ds >http.ds.txt # @TEST-EXEC: btest-diff conn.ds.txt # @TEST-EXEC: btest-diff http.ds.txt