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

[Azure Logs] Replace foreach+set combo with a script processor #34478

Merged

Conversation

zmoog
Copy link
Contributor

@zmoog zmoog commented Feb 3, 2023

What does this PR do?

Replace the foreach + set processors combo with a single script processor in the ingest pipeline for Azure AD sign-in logs.

Why is it important?

The set processor expands the dots contained in the field name into subfields.

Sometimes attributes contained in authentication_processing_details have dots, for example:

# source
{"key": "a.b.c", "value": true}

In such cases, the set processor would turn it into:

# this is a side-effect
{
  "a": {
    "b": {
      "c": true
    }
  }
}

Instead of:

# this is the expected result
{"a.b.c": True}

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@zmoog zmoog added bug Team:Cloud-Monitoring Label for the Cloud Monitoring team labels Feb 3, 2023
@zmoog zmoog self-assigned this Feb 3, 2023
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Feb 3, 2023
@zmoog zmoog changed the title Replace foreach+set combo with a script processor [Azure Logs] Replace foreach+set combo with a script processor Feb 3, 2023
@mergify
Copy link
Contributor

mergify bot commented Feb 3, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 3, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-02-07T12:53:54.685+0000

  • Duration: 71 min 44 sec

Test stats 🧪

Test Results
Failed 0
Passed 2861
Skipped 172
Total 3033

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@zmoog zmoog added the backport-7.17 Automated backport to the 7.17 branch with mergify label Feb 3, 2023
@zmoog zmoog marked this pull request as ready for review February 3, 2023 10:55
@zmoog zmoog requested a review from a team as a code owner February 3, 2023 10:55
@zmoog zmoog requested review from andrewkroh and removed request for a team February 3, 2023 10:55
@zmoog
Copy link
Contributor Author

zmoog commented Feb 3, 2023

@andrewkroh, the test file test-non-interactive-user-signin.log contains the key Legacy TLS (TLS 1.0, 1.1, 3DES).

However, the "expected" file test-non-interactive-user-signin.log-expected.json content looks correct. I guess the issue is not evident because the document uses "dot notation" for the fields. WDYT?

The integrations repo stores the expected files as a plain JSON document, so this behavior is more visible.

zmoog added 2 commits February 7, 2023 13:53
The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}
@zmoog zmoog force-pushed the zmoog/azure-authentication-processing-details-issue branch from b9fe22e to 615edbe Compare February 7, 2023 12:53
@zmoog zmoog merged commit a0b2db2 into elastic:main Feb 7, 2023
@zmoog zmoog deleted the zmoog/azure-authentication-processing-details-issue branch February 7, 2023 14:44
mergify bot pushed a commit that referenced this pull request Feb 7, 2023
* Replace foreach+set combo with a script processor

The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}

* Update changelog

(cherry picked from commit a0b2db2)
mergify bot pushed a commit that referenced this pull request Feb 7, 2023
* Replace foreach+set combo with a script processor

The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}

* Update changelog

(cherry picked from commit a0b2db2)
zmoog added a commit that referenced this pull request Feb 7, 2023
… (#34503)

* Replace foreach+set combo with a script processor

The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}

* Update changelog

(cherry picked from commit a0b2db2)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
zmoog added a commit that referenced this pull request Feb 8, 2023
… script processor (#34502)

* [Azure Logs] Replace foreach+set combo with a script processor (#34478)

* Replace foreach+set combo with a script processor

The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}

* Update changelog

(cherry picked from commit a0b2db2)

* Remove unrelated CHANGELOG entries

---------

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* Replace foreach+set combo with a script processor

The `set` processor expands the dots contained in the field name into
subfield.

Sometimes attributes contained in `authentication_processing_details`
have dots, for example:

    # source
    {"key": "a.b.c", "value": true}

In such cases, the `set` processor would turn it into:

    # this is a side-effect
    {
      "a": {
        "b": {
          "c": true
        }
      }
    }

Instead of:

    # this is the expected result
    {"a.b.c": True}

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.6.0 Automated backport with mergify bug Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat] Azure Signin Module authentication_processing_details Issue
3 participants