Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-2220 Upgrade Streaming Enrichments for HBase 2.0.2 #1486

Conversation

nickwallen
Copy link
Contributor

@nickwallen nickwallen commented Aug 16, 2019

This change upgrades the Streaming Enrichment Writer to work with HBase 2.0.2.

  • This PR is for the feature/METRON-2088-support-HDP-3.1 feature branch.

Changes

  1. Updated Streaming Enrichments to use an HBaseClient.

  2. Updated Streaming Enrichments tests to use a FakeHBaseClient.

Acceptance Testing

Basics

Verify data is flowing through the system, from parsing to indexing

  1. Open Ambari and navigate to the Metron service http://node1:8080/#/main/services/METRON/summary

  2. Open the Alerts UI

  3. Verify alerts show up in the main UI - click the search icon (you may need to wait a moment for them to appear)

  4. Head back to Ambari and select the Kibana service http://node1:8080/#/main/services/KIBANA/summary

  5. Open the Kibana dashboard via the "Metron UI" option in the quick links

  6. Verify the dashboard is populating

Streaming Enrichments and Enrichment Stellar Functions in the REPL

  1. Create a Streaming Enrichment by following these instructions.

  2. Define the streaming enrichment and save it as a new source of telemetry.

    [Stellar]>>> conf := SHELL_EDIT(conf)
    {
      "parserClassName": "org.apache.metron.parsers.csv.CSVParser",
      "writerClassName": "org.apache.metron.writer.hbase.SimpleHbaseEnrichmentWriter",
      "sensorTopic": "user",
      "parserConfig": {
        "shew.table": "enrichment",
        "shew.cf": "t",
        "shew.keyColumns": "ip",
        "shew.enrichmentType": "user",
        "columns": {
          "user": 0,
          "ip": 1
        }
      }
    }
    [Stellar]>>>
    [Stellar]>>> CONFIG_PUT("PARSER", conf, "user")
    
  3. Go to the Management UI and start the new parser called 'user'.

  4. Create some test telemetry.

    [Stellar]>>> msgs := ["user1,192.168.1.1", "user2,192.168.1.2", "user3,192.168.1.3"]
    [user1,192.168.1.1, user2,192.168.1.2, user3,192.168.1.3]
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    [Stellar]>>> KAFKA_PUT("user", msgs)
    3
    
  5. Ensure that the enrichments are persisted in HBase.

    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.1', 'enrichment', 't')
    {original_string=user1,192.168.1.1, guid=a6caf3c1-2506-4eb7-b33e-7c05b77cd72c, user=user1, timestamp=1551813589399, source.type=user}
    
    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.2', 'enrichment', 't')
    {original_string=user2,192.168.1.2, guid=49e4b8fa-c797-44f0-b041-cfb47983d54a, user=user2, timestamp=1551813589399, source.type=user}
    
    [Stellar]>>> ENRICHMENT_GET('user', '192.168.1.3', 'enrichment', 't')
    {original_string=user3,192.168.1.3, guid=324149fd-6c4c-42a3-b579-e218c032ea7f, user=user3, timestamp=1551813589402, source.type=user}
    

Pull Request Checklist

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?
  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?
  • Have you included steps or a guide to how the change may be verified and tested manually?
  • Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
  • Have you written or updated unit tests and or integration tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?

@nickwallen
Copy link
Contributor Author

No longer needed per this discussion.

@nickwallen nickwallen closed this Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant