-
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
[x-pack][filebeat] incorporate LastModified into s3 event _id generation #42078
[x-pack][filebeat] incorporate LastModified into s3 event _id generation #42078
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
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.
@stefans-elastic I think LastModified should be added to the debug log at https://github.com/elastic/beats/pull/42078/files#diff-f345fd6a1f5ea9523117d4ead2e5f1d13fb82eb1c65a089fd34fcdd514916a96R119, as now it is used for id
could you please also add a test for this change?
@@ -662,7 +663,7 @@ func Test_StorageClient(t *testing.T) { | |||
if !tt.checkJSON { | |||
val, err = got.Fields.GetValue("message") | |||
assert.NoError(t, err) | |||
assert.True(t, tt.expected[val.(string)]) | |||
assert.True(t, tt.expected[strings.ReplaceAll(val.(string), "\r", "")]) |
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.
why do we need this change in this 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.
it's because windows treating line breaks as \r\n
instead of \n
which results in tests failing on windows
This pull request is now in conflicts. Could you fix it? 🙏
|
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
Tests are passing now so I think this PR is ready for review |
@stefans-elastic I see that you initially added unit test for this PR 3041ff4 but then reverted, is it intentional? |
the implementation has changed so the test wasn't correct anymore |
@tetianakravchenko I've added a new test |
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.
LGTM
This pull request is now in conflicts. Could you fix it? 🙏
|
…ion (#42078) * [x-pack][filebeat] incorporate LastModified into s3 event _id generation * update PR id in changelog * log LastModified value * add unit test * fix unit tests on windows * use UnixMilli instead of time string * change s3 event _id format * fix changelog * Update x-pack/filebeat/input/gcs/input_test.go Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> * Update x-pack/filebeat/input/azureblobstorage/input_test.go Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> * revert windows test fix * add unit test --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> (cherry picked from commit 58a5369) # Conflicts: # x-pack/filebeat/input/awss3/s3_objects.go
…to s3 event _id generation (#42132) * [x-pack][filebeat] incorporate LastModified into s3 event _id generation (#42078) * [x-pack][filebeat] incorporate LastModified into s3 event _id generation * update PR id in changelog * log LastModified value * add unit test * fix unit tests on windows * use UnixMilli instead of time string * change s3 event _id format * fix changelog * Update x-pack/filebeat/input/gcs/input_test.go Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> * Update x-pack/filebeat/input/azureblobstorage/input_test.go Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> * revert windows test fix * add unit test --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> (cherry picked from commit 58a5369) # Conflicts: # x-pack/filebeat/input/awss3/s3_objects.go * resolve conflicts * linter fix --------- Co-authored-by: stefans-elastic <stefan.stas@elastic.co>
Proposed commit message
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Closes #42040
Use cases
Screenshots
Logs