-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce and make use of the timestamp type #1388
Conversation
f874a64
to
7316487
Compare
7316487
to
f031c29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks clean. Green light.
Before approving, we still need to give it a spin locally.
Also, while we're at it: What happens with aliases of aliases? Say I have type foo = timestamp
. Will the symmetric difference between the result of :foo:
and :timestamp
queries be the strict delta to :timestamp
? In other words, will :foo
include the results of :timestamp
?
@tobim: one todo: please add an integration that uses something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general functionality works. You missed some things, though:
❯ git grep '#timestamp' -- ':(exclude)CHANGELOG.md'
README.md:vast export json '#timestamp > 1 hour ago && (6.6.6.6 || 5353/udp)'
doc/cli/vast-explore.md:`--before`, or `--context`) apply relative to the #timestamp field of the
doc/cli/vast-export.md:vast export --max-events=100 --continuous json '#timestamp < 1 hour ago'
doc/cli/vast-export.md:`#timestamp` attribute will be exported, and only if the timestamp in that field
doc/cli/vast-import-json.md:`#timestamp` or `#skip`.
libvast/src/concept/parseable/vast/expression.cpp: VAST_WARN("#timestamp queries are deprecated and should be replaced with "
libvast/test/expression_evaluation.cpp:TEST(evaluation - attribute extractor - #timestamp) {
libvast/test/expression_evaluation.cpp: auto expr = make_conn_expr("#timestamp <= 2009-11-18T08:09");
libvast/test/expression_parseable.cpp: MESSAGE("now > #timestamp");
libvast/test/expression_parseable.cpp: str = "now > #timestamp";
libvast/test/expression_parseable.cpp: "#timestamp > 2018-07-04+12:00:00.0 && #timestamp < 2018-07-04+23:55:04.0"s,
libvast/test/meta_index.cpp: std::string q = "#timestamp == 1970-01-01+";
libvast/test/meta_index.cpp: std::string q = "#timestamp >= 1970-01-01+";
libvast/test/meta_index.cpp: q += " && #timestamp <= 1970-01-01+";
libvast/test/system/query_processor.cpp:constexpr std::string_view query_str = "#timestamp < 1 week ago";
pyvast/pyvast/test_vast.py: query = "#timestamp < 1 hour ago"
pyvast/pyvast/test_vast.py: query = ":addr == 192.168.1.104 && #timestamp < 1 hour ago"
scripts/generate-sysmon-schema.py: return "time #timestamp"
vast/integration/default_set.yaml: - command: '-N count "#timestamp >= 1970-01-01 && #type != \"vast.metrics\""'
vast/integration/default_set.yaml: - command: 'count "#timestamp >= 1970-01-01 && #type != \"vast.metrics\""'
vast/integration/default_set.yaml: - command: -N export ascii '#timestamp >= 2011-08-15T03:48'
vast/integration/misc/schema/argus.schema: StartTime: time #timestamp,
I simply changed the |
368a869
to
8405ac4
Compare
8d3d115
to
73d615c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side. Not sure if @dominiklohmann has something to add.
; | ||
return type_type(f, l, a); | ||
// Bogus indentation from clang-format ¯\_(ツ)_/¯ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked that guy 😉
My feedback is still the same @mavam:
Please change these as well. |
The parser erroneously accepted builtin type names if they were prefixes of user defined type names. For example `timestamp` would get parsed as `time`, leaving `stamp` uncomsumed.
Co-authored-by: Matthias Vallentin <matthias@tenzir.com> Co-authored-by: Dominik Lohmann <mail@dominiklohmann.de>
The `attr_list` parser is now only called once for the final type instead of for each alternative directly. The placeholder parser is back in it's old place.
The rewriting of the `#timestamp` query in the parsing step would otherwise make it impossible to extract data that is already in a db with the type `time #timestamp`. A section in this code is marked DEPRECATED and should be removed after a reasonable grace period.
a711d8e
to
c09ea02
Compare
📔 Description
📝 Checklist
🎯 Review Instructions
By commit.