Skip to content
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

[OPA-1889] Fix some of the remaining grok discrepancies #906

Merged
merged 22 commits into from
Jun 26, 2024

Conversation

vladimir-dd
Copy link
Contributor

@vladimir-dd vladimir-dd commented Jun 24, 2024

Fixes some of the found grok discrepancies/bugs, comparing to Datadog grok parser:

  • date matcher - assume the current date, year when the time format does not include them.
  • keyvalue filter - treat extracted fields as paths: db.operation means { "db": { "operation": "insert" }}
  • drop Value:Null values from the parsed object

@vladimir-dd vladimir-dd added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jun 24, 2024
@vladimir-dd vladimir-dd requested a review from neuronull June 24, 2024 11:01
@vladimir-dd vladimir-dd requested a review from pront June 24, 2024 19:28
src/datadog/grok/filters/keyvalue.rs Show resolved Hide resolved
src/datadog/grok/matchers/date.rs Outdated Show resolved Hide resolved
src/datadog/grok/matchers/date.rs Outdated Show resolved Hide resolved
src/path/mod.rs Outdated Show resolved Hide resolved
{
let tz = tz.as_str();
let tz: Tz = tz.parse().map_err(|error| {
let original_value = String::from_utf8_lossy(value.as_bytes().ok_or_else(|| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only real changes here is adjust_strp_format_and_value() function below.

@vladimir-dd vladimir-dd requested a review from pront June 25, 2024 11:21
Copy link
Contributor

@neuronull neuronull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM though I noticed CI failures. I appreciate the additional unit tests

src/datadog/grok/matchers/date.rs Show resolved Hide resolved
src/datadog/grok/parse_grok.rs Outdated Show resolved Hide resolved
@vladimir-dd vladimir-dd enabled auto-merge June 26, 2024 11:33
@vladimir-dd vladimir-dd added this pull request to the merge queue Jun 26, 2024
Merged via the queue into main with commit 38920a7 Jun 26, 2024
13 checks passed
@vladimir-dd vladimir-dd deleted the vladimir-dd/opa-1889 branch June 26, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants