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

Cherry-pick #18585 to 7.x: Add support for array parsing in azure-eventhub input #18650

Merged
merged 2 commits into from
May 20, 2020

Conversation

narph
Copy link
Contributor

@narph narph commented May 20, 2020

Cherry-pick of PR #18585 to 7.x branch. Original message:

What does this PR do?

Adds support to parse array of eventhub messages into separate events.
Expected type was an object containing a list of messages.

Why is it important?

List of eventhub messages were published in single Elasticsearch event.

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.

Ex before:

          "message" : """[{"data":"{\"Id\":\"https://testnamekey.vault.azure.net/keys/weewewew/....\",\"VaultName\":\"testnamekey\",\"ObjectType\":\"Key\",\"ObjectName\":\"weewewew\",\"Version\":\"....\",\"NBF\":null,\"EXP\":null}","dataschema":"#1","id":"tt589454itekjter94oi","source":"/subscriptions/.../resourceGroups/obs-infrastructure/providers/Microsoft.KeyVault/vaults/testnamekey","specversion":"1.0","subject":"weewewew","time":"2020-05-15T12:08:09.616451Z","type":"Microsoft.KeyVault.KeyNewVersionCreated"}]""",
          "azure" : {
            "offset" : 2560,
            "sequence_number" : 3,
            "enqueued_time" : "2020-05-15T12:08:11.232Z",
            "eventhub" : "keyvalut",
            "consumer_group" : "test"
          },
          "input" : {
            "type" : "azure-eventhub"
          }
        },

to:

          "message" : """{"data":"{\"Id\":\"https://testnamekey.vault.azure.net/keys/weewewew/....\",\"VaultName\":\"testnamekey\",\"ObjectType\":\"Key\",\"ObjectName\":\"weewewew\",\"Version\":\"tt589454itekjter94oi\",\"NBF\":null,\"EXP\":null}","dataschema":"#1","id":"....","source":"/subscriptions/...../resourceGroups/obs-infrastructure/providers/Microsoft.KeyVault/vaults/testnamekey","specversion":"1.0","subject":"weewewew","time":"2020-05-15T12:08:09.616451Z","type":"Microsoft.KeyVault.KeyNewVersionCreated"}""",
          "azure" : {
            "offset" : 2560,
            "sequence_number" : 3,
            "enqueued_time" : "2020-05-15T12:08:11.232Z",
            "eventhub" : "keyvalut",
            "consumer_group" : "test"
          },
          "input" : {
            "type" : "azure-eventhub"
          }
        },

* add array as parser

* changelog

* update test

(cherry picked from commit c742662)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 20, 2020
@narph narph self-assigned this May 20, 2020
@narph narph added [zube]: In Review backport Team:Platforms Label for the Integrations - Platforms team labels May 20, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 20, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 20, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 0
Passed 1683
Skipped 255
Total 1938

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

LGTM!

@narph narph merged commit 7610e2a into elastic:7.x May 20, 2020
@narph narph deleted the backport_18585_7.x branch May 20, 2020 13:55
@zube zube bot removed the [zube]: Done label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants