You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by nickwallen <gi...@git.apache.org> on 2017/05/08 21:42:34 UTC

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

GitHub user nickwallen opened a pull request:

    https://github.com/apache/incubator-metron/pull/570

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

    ## Changes
    
    * I have altered Pycapa so that it can consume messages from either the beginning, end or the previously stored offsets of a topic.  This can be done using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or `stored`.  This defaults to `end`.
    * Added additional information when using the `--pretty-print` flag.  It will now show the partition and offset for a packet, both on the producer-side (sending packets to Kafka) or the consumer-side (receiving packets from Kafka).
    
    ## Testing
    
    1. Install Pycapa.
    
    1. Launch a Kafka Broker on your localhost.  For example, using Kafka installed via Brew on my Mac.
    
       ```
       export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
       export KAFKA_CONF=$KAFKA_HOME/libexec/config
       zookeeper-server-start $KAFKA_CONF/zookeeper.properties
       kafka-server-start $KAFKA_CONF/server.properties
       ```
    
    1. Produce some packets.  Assumes you're actively using `en0` and Kafka is at `localhost:9092`.  Let it run until it completes and captures 50 packets.
    
        ```
         pycapa --producer \
            --interface en0 \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap \
            --max-packets 50
        ```
    
    1. Run the consumer. The consumer will not consume any packets.  It starts from the end of the topic, by default, and since there are no active producers, there is nothing new to consume.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
        ```
    
    1. Run the consumer again, but start from the beginning of the topic.  You should be able to consume all 50 packets.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
            --kafka-offset begin
        ```
    
    
    ## Pull Request Checklist
    
    - [ ] 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)?
    - [ ] 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 incubating-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](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?
    - [ ] 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`:
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickwallen/incubator-metron METRON-937

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #570
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen closed the pull request at:

    https://github.com/apache/incubator-metron/pull/570


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen closed the pull request at:

    https://github.com/apache/incubator-metron/pull/570


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
GitHub user nickwallen reopened a pull request:

    https://github.com/apache/incubator-metron/pull/570

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

    ## Changes
    
    * I have altered Pycapa so that it can consume messages from either the beginning, end or the previously stored offsets of a topic.  This can be done using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or `stored`.  This defaults to `end`.
    * Added additional information when using the `--pretty-print` flag.  It will now show the partition and offset for a packet, both on the producer-side (sending packets to Kafka) or the consumer-side (receiving packets from Kafka).
    
    ## Testing
    
    1. Install Pycapa.
    
    1. Launch a Kafka Broker on your localhost.  For example, using Kafka installed via Brew on my Mac.
    
       ```
       export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
       export KAFKA_CONF=$KAFKA_HOME/libexec/config
       zookeeper-server-start $KAFKA_CONF/zookeeper.properties
       kafka-server-start $KAFKA_CONF/server.properties
       ```
    
    1. Produce some packets.  Assumes you're actively using `en0` and Kafka is at `localhost:9092`.  Let it run until it completes and captures 50 packets.
    
        ```
         pycapa --producer \
            --interface en0 \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap \
            --max-packets 50
        ```
    
    1. Run the consumer. The consumer will not consume any packets.  It starts from the end of the topic, by default, and since there are no active producers, there is nothing new to consume.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
        ```
    
    1. Run the consumer again, but start from the beginning of the topic.  You should be able to consume all 50 packets.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
            --kafka-offset begin
        ```
    
    
    ## Pull Request Checklist
    
    - [x] 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). 
    - [x] 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.
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
    - [x] Have you included steps or a guide to how the change may be verified and tested manually?
    - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via:
    - [x] Have you written or updated unit tests and or integration tests to verify your changes?
    - [x] 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)? 
    - [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
    - [x] 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`:
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickwallen/incubator-metron METRON-937

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #570
    
----
commit 23af8e9535ee396ce1a722b51672d4e8a9a69b4d
Author: Nick Allen <ni...@nickallen.org>
Date:   2017-05-05T21:51:05Z

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
GitHub user nickwallen reopened a pull request:

    https://github.com/apache/incubator-metron/pull/570

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

    ## Changes
    
    * I have altered Pycapa so that it can consume messages from either the beginning, end or the previously stored offsets of a topic.  This can be done using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or `stored`.  This defaults to `end`.
    * Added additional information when using the `--pretty-print` flag.  It will now show the partition and offset for a packet, both on the producer-side (sending packets to Kafka) or the consumer-side (receiving packets from Kafka).
    
    ## Testing
    
    1. Install Pycapa.
    
    1. Launch a Kafka Broker on your localhost.  For example, using Kafka installed via Brew on my Mac.
    
       ```
       export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
       export KAFKA_CONF=$KAFKA_HOME/libexec/config
       zookeeper-server-start $KAFKA_CONF/zookeeper.properties
       kafka-server-start $KAFKA_CONF/server.properties
       ```
    
    1. Produce some packets.  Assumes you're actively using `en0` and Kafka is at `localhost:9092`.  Let it run until it completes and captures 50 packets.
    
        ```
         pycapa --producer \
            --interface en0 \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap \
            --max-packets 50
        ```
    
    1. Run the consumer. The consumer will not consume any packets.  It starts from the end of the topic, by default, and since there are no active producers, there is nothing new to consume.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
        ```
    
    1. Run the consumer again, but start from the beginning of the topic.  You should be able to consume all 50 packets.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
            --kafka-offset begin
        ```
    
    
    ## Pull Request Checklist
    
    - [x] 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). 
    - [x] 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.
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
    - [x] Have you included steps or a guide to how the change may be verified and tested manually?
    - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via:
    - [x] Have you written or updated unit tests and or integration tests to verify your changes?
    - [x] 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)? 
    - [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
    - [x] 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`:
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickwallen/incubator-metron METRON-937

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #570
    
----
commit 23af8e9535ee396ce1a722b51672d4e8a9a69b4d
Author: Nick Allen <ni...@nickallen.org>
Date:   2017-05-05T21:51:05Z

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron issue #570: METRON-937 Pycapa Consume Messages from Begin, ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/incubator-metron/pull/570
  
    travis!
    
    ```
    Running org.apache.metron.parsers.integration.YafIntegrationTest
    Running Sample Data Validation on sensorType yaf
    2017-05-09 13:31:23 ERROR ParserTopologyComponent:114 - Storm slots didn't shut down entirely cleanly *sigh*.  I gave them the old one-two-skadoo and killed the slots with prejudice.  If tests fail, we'll have to find a better way of killing them.
    java.lang.IllegalStateException: It took over 60000ms to shut down slot Thread[SLOT_1024,5,main]
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
GitHub user nickwallen reopened a pull request:

    https://github.com/apache/incubator-metron/pull/570

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

    ## Changes
    
    * I have altered Pycapa so that it can consume messages from either the beginning, end or the previously stored offsets of a topic.  This can be done using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or `stored`.  This defaults to `end`.
    * Added additional information when using the `--pretty-print` flag.  It will now show the partition and offset for a packet, both on the producer-side (sending packets to Kafka) or the consumer-side (receiving packets from Kafka).
    
    ## Testing
    
    1. Install Pycapa.
    
    1. Launch a Kafka Broker on your localhost.  For example, using Kafka installed via Brew on my Mac.
    
       ```
       export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
       export KAFKA_CONF=$KAFKA_HOME/libexec/config
       zookeeper-server-start $KAFKA_CONF/zookeeper.properties
       kafka-server-start $KAFKA_CONF/server.properties
       ```
    
    1. Produce some packets.  Assumes you're actively using `en0` and Kafka is at `localhost:9092`.  Let it run until it completes and captures 50 packets.
    
        ```
         pycapa --producer \
            --interface en0 \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap \
            --max-packets 50
        ```
    
    1. Run the consumer. The consumer will not consume any packets.  It starts from the end of the topic, by default, and since there are no active producers, there is nothing new to consume.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
        ```
    
    1. Run the consumer again, but start from the beginning of the topic.  You should be able to consume all 50 packets.
    
        ```
        pycapa --consumer \
            --kafka-broker localhost:9092 \
            --kafka-topic pcap
            --pretty-print 1
            --kafka-offset begin
        ```
    
    
    ## Pull Request Checklist
    
    - [x] 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). 
    - [x] 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.
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
    - [x] Have you included steps or a guide to how the change may be verified and tested manually?
    - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via:
    - [x] Have you written or updated unit tests and or integration tests to verify your changes?
    - [x] 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)? 
    - [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
    - [x] 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`:
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickwallen/incubator-metron METRON-937

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #570
    
----
commit 23af8e9535ee396ce1a722b51672d4e8a9a69b4d
Author: Nick Allen <ni...@nickallen.org>
Date:   2017-05-05T21:51:05Z

    METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron issue #570: METRON-937 Pycapa Consume Messages from Begin, ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/incubator-metron/pull/570
  
    travis!
    
    ```
    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running org.apache.metron.pcap.integration.PcapTopologyIntegrationTest
    Formatting using clusterid: testClusterID
    Processing: ip_dst_addr => 207.28.210.1
    Processing: protocol => foo
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Processing: ip_dst_port => 22
    Ended
    2017-05-09 14:39:20 ERROR ReadClusterState:345 - Error trying to shutdown workers in Thread[SLOT_1027,5,main]
    java.lang.IllegalStateException: It took over 60000ms to shut down slot Thread[SLOT_1027,5,main]
    	at org.apache.storm.daemon.supervisor.ReadClusterState$1.call(ReadClusterState.java:294)
    	at org.apache.storm.daemon.supervisor.ReadClusterState$1.call(ReadClusterState.java:292)
    	at org.apache.storm.daemon.supervisor.ReadClusterState$3.call(ReadClusterState.java:307)
    	at org.apache.storm.daemon.supervisor.ReadClusterState$3.call(ReadClusterState.java:304)
    	at org.apache.storm.daemon.supervisor.ReadClusterState.shutdownAllWorkers(ReadClusterState.java:333)
    	at org.apache.storm.daemon.supervisor.Supervisor.shutdownAllWorkers(Supervisor.java:330)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:483)
    	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    	at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    	at org.apache.storm.testing$kill_local_storm_cluster.invoke(testing.clj:204)
    	at org.apache.storm.LocalCluster$_shutdown.invoke(LocalCluster.clj:66)
    	at org.apache.storm.LocalCluster.shutdown(Unknown Source)
    	at org.apache.metron.integration.components.FluxTopologyComponent.stop(FluxTopologyComponent.java:159)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron pull request #570: METRON-937 Pycapa Consume Messages from ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen closed the pull request at:

    https://github.com/apache/incubator-metron/pull/570


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-metron issue #570: METRON-937 Pycapa Consume Messages from Begin, ...

Posted by nickwallen <gi...@git.apache.org>.
Github user nickwallen commented on the issue:

    https://github.com/apache/incubator-metron/pull/570
  
    kick travis 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---