-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Migrate beat.* to agent.* #8873
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,6 @@ def test_beat_fields(self): | |
|
||
output = self.read_output() | ||
doc = output[0] | ||
assert doc["beat.name"] == "testShipperName" | ||
assert doc["beat.hostname"] == socket.gethostname() | ||
assert doc["host.name"] == "testShipperName" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be updated to "host.hostname", no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have |
||
assert doc["agent.hostname"] == socket.gethostname() | ||
assert "fields" not in doc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,11 +190,11 @@ def _test_expected_events(self, test_file, objects): | |
|
||
def clean_keys(obj): | ||
# These keys are host dependent | ||
host_keys = ["host.name", "beat.hostname", "beat.name"] | ||
host_keys = ["host.name", "agent.hostname", "agent.type"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same: "host.name" => "host.hostname" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the intention is to stick to "host.name" in 6.x and move to "host.hostname" in 7.x? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still need to figure that one out. This PR keeps the same behaviour as we had. |
||
# The create timestamps area always new | ||
time_keys = ["read_timestamp", "event.created"] | ||
# source path and beat.version can be different for each run | ||
other_keys = ["source", "beat.version"] | ||
other_keys = ["source", "agent.version"] | ||
|
||
for key in host_keys + time_keys + other_keys: | ||
delete_key(obj, key) | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
@bleskes This is the file I have in mind to track the migration of the fields so it can be used later to do automatic migrations.
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.
👍
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.
What's the meaning of this structure? I'm wondering about the direction of the alias this is suggesting:
offset
is type alias, and points to the data inlog.offset
?log.offset
is type alias, and points to the data inoffset
?Since we may actually do both, I think we should rename the keys of the structures slightly.
I currently read them as "old field is in
from
" and "new field is into
". However when you read with the strategy in mind, it reads like "alias from offset to log.offset", which is confusing.What do you think about the following?
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 messed up the meaning of which strategy made sense in which version. Updated my comment above :)
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.
Not a blocker for this PR, just to be clear. Just maybe a thing to rethink in a separate PR
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 structure can still change, what is important right now is that we have a structure way of documenting it. We can focus on naming later.