[Backport 7.58.x] Fix duplicate tags in TCP/UDP logs (again) #30318
+79
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Backports commit #29780 into 7.58.x
The previous backport PR was reverted due to merging before 7.58.1 was ready
Below is copied from previous PR.
Fixes bug where duplicate tags occur in UDP/TCP logs
Motivation
Issue
Describe how to test/QA your changes
Inside
conf.yaml
, add the followingCreate the file if needed
dev/dist/conf.d/test.d/conf.yaml
Inside Datadog.yaml, enable logs and have tags as well
Run the agent
./bin/agent/agent run -c bin/agent/dist/datadog.yaml
In a different terminal, get the logs from the agent
./bin/agent/agent stream-logs -c bin/agent/dist/datadog.yaml
In a different terminal, send logs to the agent
echo -n "this is my log" | nc -u -w 1 127.0.0.1 10518
Ensure that the tags are not duplicated in the terminal that gets the logs
Different QA steps are also provided in the ticket if needed