You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by GitBox <gi...@apache.org> on 2019/09/05 21:18:21 UTC

[GitHub] [metron] nickwallen opened a new pull request #1502: METRON-2248 Merge Master into Feature Branch

nickwallen opened a new pull request #1502: METRON-2248 Merge Master into Feature Branch
URL: https://github.com/apache/metron/pull/1502
 
 
   This change merges the latest from master into the `feature/METRON-2088-support-hdp-3.1` feature branch.  The most significant changes impacting the feature branch including METRON-2217 and METRON-2149.
   
   Since the merge with master resulted in some merge conflicts and additional changes to ensure that things continued to work, I want to open a PR for this work.  
   
   This PR will show all of the commits from master that are being merged into the feature branch, along with the last 5 commits that highlight changes that were required to make the merge successful.
   
   ## Acceptance Testing
   
   This PR should be tested using the centos6 development environment.
   ```
   cd metron-deployment/development/centos6
   vagrant destroy -f
   vagrant up
   ```
   
   ### Basics
   
   Ensure that we can continue to parse, enrich, and index telemetry.  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
   
     1. Open the Alerts UI
   
     1. Verify alerts show up in the main UI - click the search icon (you may need to wait a moment for them to appear)
   
     1. Head back to Ambari and select the Kibana service http://node1:8080/#/main/services/KIBANA/summary
   
     1. Open the Kibana dashboard via the "Metron UI" option in the quick links
   
     1. Verify the dashboard is populating
   
   
   ### REST
   
   In addition, you can follow these steps to save and retrieve a user setting.
   
   1. Go to the Swagger UI.
   
   1. Retrieve the current user's settings using `GET /api/v1/alerts/ui/settings`. This should return 404 initially indicating there are no settings for the current user.
   
   1. Save a user setting.  Pass the following as the `alertsUIUserSettings` body to `POST /api/v1/alerts/ui/settings`.
       ```
       {
         "facetFields": [
           "ip_src_addr"
         ],
         "user": "admin"
       }
       ```
   
   1. Retrieve the setting again using `GET /api/v1/alerts/ui/settings`.  This should return 200 with the following response body
       ```
       {
         "user": "admin",
         "tableColumns": null,
         "savedSearches": null,
         "facetFields": [
           "ip_src_addr"
         ]
       }
       ```
   
   ### Profiler in the REPL
   
   1. Test a profile in the REPL according to [these instructions](https://github.com/apache/metron/tree/master/metron-analytics/metron-profiler-repl#getting-started).
   
       ```
       [Stellar]>>> values := PROFILER_FLUSH(profiler)
       [{period={duration=900000, period=1723089, start=1550780100000, end=1550781000000}, profile=hello-world, groups=[], value=4, entity=192.168.138.158}]
       ```
   
   ### Streaming Profiler
    
   1. Deploy that profile to the Streaming Profiler in Storm.
   
       ```
       [Stellar]>>> CONFIG_PUT("PROFILER", conf)
       ```
   
   1. Wait for the Streaming Profiler in Storm to flush and retrieve the measurement from HBase.  
   
       For the impatient, you can reset the period duration to 1 minute. Alternatively, you can allow the Profiler topology to work for a minute or two and then kill the `profiler` topology which will force it to flush a profile measurement to HBase.
   
       Retrieve the measurement from HBase.  Prior to this PR, it was not possible to query HBase from the REPL.
       ```
       [Stellar]>>> PROFILE_GET("hello-world","192.168.138.158",PROFILE_FIXED(30,"DAYS"))
       [2979]
       ```
   
   ### Batch Profiler
   
   1. Install Spark using Ambari.
   
       1. Stop Storm, YARN, Elasticsearch, Kibana, and Kafka.
   
       1. Install Spark2 using Ambari.
   
       1. Ensure that Spark can talk with HBase.
           ```
           cp /etc/hbase/conf/hbase-site.xml /etc/spark2/conf/
           ```
   
   1. Use the Batch Profiler to back-fill your profile.  To do this, follow the direction [provided here](https://github.com/apache/metron/tree/master/metron-analytics/metron-profiler-spark#getting-started).
   
   1. Retrieve the entire profile, including the back-filled data.
   
       ```
       [Stellar]>>> PROFILE_GET("hello-world","192.168.138.158",PROFILE_FIXED(30,"DAYS"))
       [1203, 2849, 2900, 1944, 1054, 1241, 1721]
       ```
   
   ###  Streaming Enrichments and Enrichment Stellar Functions in the REPL
   
     1. Create a Streaming Enrichment [by following these instructions](https://cwiki.apache.org/confluence/display/METRON/2016/06/16/Metron+Tutorial+-+Fundamentals+Part+6%3A+Streaming+Enrichment).
   
     1. 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")
         ```
   
     1. Go to the Management UI and start the new parser called 'user'.
   
     1. 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
         ```
   
     1. 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
   
   Thank you for submitting a contribution to Apache Metron.  
   Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.  
   Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides.  
   
   
   In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
   - [ ] 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)?
   
   
   ### For code changes:
   - [ ] 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:
     ```
     mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
     ```
   
   - [ ] 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](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`:
   
     ```
     cd site-book
     mvn site
     ```
   
   - [ ] Have you ensured that any documentation diagrams have been updated, along with their source files, using [draw.io](https://www.draw.io/)? See [Metron Development Guidelines](https://cwiki.apache.org/confluence/display/METRON/Development+Guidelines) for instructions.
   
   #### Note:
   Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
   It is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services